コード例 #1
0
    private void SpawnEnemy(EnemyType type)
    {
        switch (type)
        {
        case EnemyType.ZOMBIE:
            EnemyZombie zombie = PoolManager.Spawn <EnemyZombie>(transform) as EnemyZombie;
            if (zombie == null)
            {
                return;
            }
            zombie.transform.position = transform.position;
            break;

        case EnemyType.MOOD_GUY:
            EnemyRanged ranged = PoolManager.Spawn <EnemyRanged>(transform) as EnemyRanged;
            if (ranged == null)
            {
                return;
            }
            ranged.transform.position = transform.position;
            break;

        default:
            break;
        }
    }
コード例 #2
0
 void Start()
 {
     zombie = GameObject.FindGameObjectWithTag("Zombie").GetComponent <EnemyZombie> ();
     spider = GameObject.FindGameObjectWithTag("Enemy").GetComponent <Spider> ();
 }