Esempio n. 1
0
        // Start is called before the first frame update
        void Awake()
        {
            if (instance == null)
            {
                instance = this;
            }

            characterStatusLayout = GetComponent <CharacterStatusLayout>();

            alchemyManager      = GetComponent <AlchemyManager>();
            statusAffectedCells = new List <CellAlchemyState>();

            foreach (GameObject player in GameObject.FindGameObjectsWithTag("Player"))
            {
                playersDict.Add(player.GetComponent <CharacterStats>().characterName, player.GetComponent <PlayerManager>());
                player.GetComponent <CharacterStats>().statusPanel = Instantiate(playerStatusPrefab);
            }

            foreach (GameObject enemy in GameObject.FindGameObjectsWithTag("Enemy"))
            {
                enemiesDict.Add(enemy.GetComponent <CharacterStats>().characterName, enemy.GetComponent <EnemyManager>());
                enemy.GetComponent <CharacterStats>().statusPanel = Instantiate(enemyStatusPrefab);
            }

            currentCharacter = playersDict.Values.ToArray()[0];
            currentCharacter.isCurrentPlayer = true;
            isPlayerTurn = true;

            currentEnemy = enemiesDict.Values.ToArray()[0];
            //currentCharacter.playerModel.GetComponent<Renderer>().material.SetFloat("OnOff", 1);
            SetUICam();
        }
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }