Exemple #1
0
    // Use this for initialization
    IEnumerator Start()
    {
        if (GameObject.Find("LoadingPlayer"))
        {
            if (PlayerPrefs.HasKey("wins"))
            {
                wins = PlayerPrefs.GetInt("wins");
            }
            if (PlayerPrefs.HasKey("name") && !instantiatedLobbyPlayer)
            {
                SyncData.name = PlayerPrefs.GetString("name");
                playerName    = SyncData.name;

                text.text = playerName;
            }
            text.color = parent.GetComponent <ColourSetterLoad>().m_NewColor;
        }
        else
        {
            yield return(new WaitForSeconds(1f));

            if (!hasAuthority)
            {
                parent    = serverParent;
                healthAI  = parent.GetComponent <HealthAI>();
                text.text = playerName;
            }
            text.color = parent.GetComponent <ColourSetterAI>().m_NewColor;
        }
    }
Exemple #2
0
 public void CmdUpdateParent(GameObject parentObject)
 {
     parent       = parentObject;
     healthAI     = parent.GetComponent <HealthAI>();
     serverParent = parent;
     RpcUpdateParent(parent);
 }
 // Use this for initialization
 IEnumerator Start()
 {
     while (playerManagement == null)
     {
         yield return(null);
     }
     players   = playerManagement.totalPlayers;
     text.text = "Players Left: " + players.ToString();
     if (SyncData.gameMode == 2)
     {
         while (playerManagement.playerSpawnedReal == null)
         {
             yield return(null);
         }
         health      = playerManagement.playerSpawnedReal.GetComponent <HealthAI>();
         spawnRocket = playerManagement.playerSpawnedReal.GetComponent <SpawnRocketAI>();
     }
 }
Exemple #4
0
 public void RpcUpdateParent(GameObject parentObject)
 {
     parent   = parentObject;
     healthAI = parent.GetComponent <HealthAI>();
 }