void OnPhotonInstantiate(PhotonMessageInfo info) { GameJamGameManager gm = GameJamGameManager.instance; // e.g. store this gameobject as this player's charater in PhotonPlayer.TagObject PhotonView pv = GetComponent <PhotonView>(); id = (int)pv.instantiationData[0]; Debug.Log("ID: " + id); // gameObject.transform.SetParent(playersParent.transform); gm.players.Add(this); if (id == GameJamGameManager.LocalPlayerId) { gameObject.name = "Active Player"; CameraFollow.instance.target = transform; } else { if (PhotonNetwork.player.IsMasterClient) { pv.TransferOwnership(id); } gameObject.name = "Other Player"; } initialColorAssignment(); }
protected override void Update() { GameJamGameManager m = GameJamGameManager.instance; if (m.totalHiveStartHealth != 0) { spawnRate = m.totalHiveHealth <= 0 ? 0 : (maxSpawnRate - minSpawnRate) * ((float)m.totalHiveHealth / (float)m.totalHiveStartHealth) + minSpawnRate; } base.Update(); }
void OnPhotonInstantiate(PhotonMessageInfo info) { GameJamGameManager gm = GameJamGameManager.instance; // e.g. store this gameobject as this player's charater in PhotonPlayer.TagObject PhotonView pv = GetComponent <PhotonView>(); SetEnemyColor((int)pv.instantiationData[0]); GameJamGameManager.instance.totalHiveStartHealth += startingHealth; GameJamGameManager.instance.totalHiveHealth += startingHealth; }
//private TankManager m_RoundWinner; // Reference to the winner of the current round. Used to make an announcement of who won. //private TankManager m_GameWinner; // Reference to the winner of the game. Used to make an announcement of who won. void Awake() { s_Instance = this; }