Пример #1
0
 public Game()
 {
     player1     = new s_Player();
     camera      = new s_Camera();
     UI_Data     = new s_UIData();
     enemy       = new s_Enemy();
     s_enemyList = new List <s_Enemy>();
 }
Пример #2
0
    public void saveEnemyData()
    {
        GameObject[] gameEnemies = GameObject.FindGameObjectsWithTag("Enemy");
        s_Enemy      tempEnemy;

        foreach (GameObject gameEnemy in gameEnemies)
        {
            tempEnemy = new s_Enemy();
            EnemyHealth tempHealth = gameEnemy.GetComponent <EnemyHealth>();
            tempEnemy.currentHealth = tempHealth.currentHealth;

            tempEnemy.positionX = gameEnemy.transform.position.x;
            tempEnemy.positionY = gameEnemy.transform.position.y;
            tempEnemy.positionZ = gameEnemy.transform.position.z;

            StateController tempState = gameEnemy.GetComponent <StateController>();
            tempEnemy.type       = tempState.tempName;
            tempEnemy.spawnIndex = tempState.SpawnPointIndex;
            tempEnemy.laneIndex  = tempState.LaneIndex;

            s_enemyList.Add(tempEnemy);
        }
    }