Game Manager script
using [Link];
using [Link];
using UnityEngine;
using [Link];
public class GameManager : MonoBehaviourPunCallbacks
public static GameManager instance;
[SerializeField]
private GameObject playerPrefab;
[SerializeField]
private Transform[] playerBases;
int i = 0;
int n;
public int spawnPoint;
public int playerCount;
private void Awake()
if (instance != null)
Destroy([Link]);
1
}
else
instance = this;
// Start is called before the first frame update
void Start()
spawnPoint = [Link](i, [Link] - 1);
if ([Link])
if (playerPrefab != null)
[Link]([Link],
playerBases[spawnPoint].position + new Vector3(0f, 50f, 1f),
[Link]);
playerBases[spawnPoint].GetComponentInChildren<Light>
().[Link](true);
else
[Link]("missing player prefab");
2
}
// Update is called once per frame
void Update()
public override void OnJoinedRoom()
[Link]([Link] + " joined to " +
[Link]);
public override void OnPlayerEnteredRoom(Player newPlayer)
[Link]([Link] + " joined to " +
[Link] + " " +
[Link]);
public override void OnLeftRoom()
[Link](0);
3
public void LeaveRoom()
[Link]();