Esempio n. 1
0
    private void Setup()
    {
        controlMovingCubes = true;
        currentWaveNumber  = -1;

        lineRenderer.positionCount = 2;

        if (SavedObjects.UIDispetcher == null)
        {
            SavedObjects.UIDispetcher = Instantiate(playerUI);
        }
        if (SavedObjects.player == null)
        {
            SavedObjects.player = Instantiate(player, Vector3.zero, Quaternion.identity);
        }
        SavedObjects.UIDispetcher.GetComponent <UIDispetcher>().Setup();
        SavedObjects.player.GetComponent <InputMove>().Setup(playerStartPos[SavedObjects.toArena? 1: 0]);
        SavedObjects.player.GetComponent <PlayerInventory>().Setup();

        replicDispether = SavedObjects.UIDispetcher.GetComponent <UIDispetcher>().replicDispether;
        foreach (var item in replicPoints)
        {
            item.replicDispether = replicDispether;
        }
        replicDispether.Setup();
        replicDispether.ClearList();
    }
Esempio n. 2
0
 private IEnumerator GetReplicDispethcer()
 {
     while (replicDispether == null)
     {
         try
         {
             replicDispether = SavedObjects.UIDispetcher.GetComponent <UIDispetcher>().replicDispether;
         }
         catch
         {
         }
         yield return(null);
     }
 }