Beispiel #1
0
 public void Clone(EnemyMinion minion)
 {
     this.prefabName = minion.GetName();
     this.health     = minion.GetHealth();
     this.damage     = minion.GetDamage();
     this.armour     = minion.GetArmour();
 }
Beispiel #2
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...");
        }
    }