コード例 #1
0
 public void Clone(EnemyMinion minion)
 {
     this.prefabName = minion.GetName();
     this.health     = minion.GetHealth();
     this.damage     = minion.GetDamage();
     this.armour     = minion.GetArmour();
 }
コード例 #2
0
    public EnemyMinion[] SpawnWave()
    {
        EnemyMinionFactory minionFactory = new EnemyMinionFactory();

        EnemyMinion[] listOfWave = new EnemyMinion[wave.Length];
        for (int i = 0; i < wave.Length; i++)
        {
            listOfWave[i] = minionFactory.MakeEnemyMinion(wave[i]);
        }
        return(listOfWave);
    }
コード例 #3
0
    private void InstantiateEnemy(EnemyMinion minion)
    {
        GameObject enemyMinion = Resources.Load("Characters/Enemy/" + minion.GetName()) as GameObject;

        if (enemyMinion != null)
        {
            if (enemyMinion.GetComponent("MinionData") != null)
            {
                //enemyMinion.GetComponent<MinionData>().Clone(minion);
            }
            else
            {
                enemyMinion.AddComponent <MinionData>();
                enemyMinion.GetComponent <MinionData>().Clone(minion);
            }
            enemyMinion.tag = "player2";
            Instantiate(enemyMinion, this.transform.position, this.transform.rotation);
        }
        else
        {
            Debug.Log("Can not spawn null...");
        }
    }
コード例 #4
0
    public EnemyMinion[] SpawnWave()
    {
        EnemyMinionFactory minionFactory = new EnemyMinionFactory();
        int length = Random.Range(1, 4);

        EnemyMinion[] listOfWave = new EnemyMinion[length];
        for (int i = 0; i < length; i++)
        {
            int randNum = Random.Range(1, 10);
            if (randNum >= 1 && randNum < 6)
            {
                listOfWave[i] = minionFactory.MakeEnemyMinion(wave[0]);
            }
            else if (randNum >= 6 && randNum < 10)
            {
                listOfWave[i] = minionFactory.MakeEnemyMinion(wave[1]);
            }
            else
            {
                listOfWave[i] = minionFactory.MakeEnemyMinion(wave[2]);
            }
        }
        return(listOfWave);
    }
コード例 #5
0
 void Reset()
 {
     Owner = GetComponentInParent <EnemyMinion>();
 }