Esempio n. 1
0
 public void Start()
 {
     foreach (Renderer r in GetComponentsInChildren <Renderer>())
     {
         r.material.color = AsteroidsPlayerData.GetColor(photonView.Owner.GetPlayerNumber());
     }
 }
Esempio n. 2
0
 private void OnPlayerNumberingChanged()
 {
     foreach (Player p in PhotonNetwork.PlayerList)
     {
         if (p.ActorNumber == ownerId)
         {
             PlayerColorImage.color = AsteroidsPlayerData.GetColor(p.GetPlayerNumber());
         }
     }
 }
Esempio n. 3
0
        public void Awake()
        {
            playerListEntries = new Dictionary <int, GameObject>();

            foreach (Player p in PhotonNetwork.PlayerList)
            {
                GameObject entry = Instantiate(PlayerOverviewEntryPrefab);
                entry.transform.SetParent(gameObject.transform);
                entry.transform.localScale        = Vector3.one;
                entry.GetComponent <Text>().color = AsteroidsPlayerData.GetColor(p.GetPlayerNumber());
                entry.GetComponent <Text>().text  = string.Format("{0}\nScore: {1}\nLives: {2}", p.NickName, p.GetScore(), AsteroidsPlayerData.PLAYER_MAX_LIVES);

                playerListEntries.Add(p.ActorNumber, entry);
            }
        }