Esempio n. 1
0
    public void InitGame()
    {
        this.gameUI                 = GameObject.Find("GameUI").GetComponent <GameUIManager>();
        this.environment            = GameObject.Find("Environment");
        this.playerObject           = this.environment.transform.GetChild(1).GetChild(0).gameObject;
        this.enemyObject            = this.environment.transform.GetChild(1).GetChild(1).gameObject;
        this.playerStats            = playerObject.GetComponent <PlayerMechanics>();
        this.enemyStats             = enemyObject.GetComponent <EnemyMechanics>();
        this.instructionsGameObject = GameObject.Find("Tiles");
        this.instructionsGameObject.SetActive(false);
        this.arenaGameObject = environment.transform.GetChild(0).gameObject;
        this.arenaCells      = new GameObject[6, 6];
        this.arenaCellData   = new int[6, 6];

        for (int i = 0; i < this.arenaCells.GetLength(0); i++)
        {
            for (int j = 0; j < this.arenaCells.GetLength(1); j++)
            {
                this.arenaCells[i, j] = this.arenaGameObject.transform.GetChild(i).GetChild(j).gameObject;
                if (this.arenaCells[i, j].transform.childCount > 0)
                {
                    arenaCellData[i, j] = 1;
                }
                else
                {
                    arenaCellData[i, j] = 0;
                }
            }
        }

        StartCoolDownTimer(10);
    }
Esempio n. 2
0
 void StartParameters()
 {
     this._enemyMechanics = GetComponent <EnemyMechanics>();
     this._enemy          = GetComponent <Enemy>();
     targetNavPoint       = NavigationPoints.navPointsArray[_navPointIndex];
     this._navMeshAgent   = _enemy.GetComponent <NavMeshAgent>();
 }
Esempio n. 3
0
    public void InitGame()
    {
//		this.gameUI = GameObject.Find("GameUI").GetComponent<GameUIManager>();

        playerMechanics = gm.GetPlayerMechanics();
        enemyMechanics  = gm.GetEnemyMechanics();

        gm.HideInstructionUI();

        if (SceneManager.GetActiveScene().name == "GameNewPhase")
        {
            StartCoolDownTimer(3);
        }
        else
        {
            StartCoolDownTimer(8);
        }
    }
Esempio n. 4
0
 private void Awake()
 {
     gm = GetComponent <GameManagement>();
     playerMechanics = gm.GetPlayerMechanics();
     enemyMechanics  = gm.GetEnemyMechanics();
 }