本文整理汇总了C#中EnemyController.EnterGameArea方法的典型用法代码示例。如果您正苦于以下问题:C# EnemyController.EnterGameArea方法的具体用法?C# EnemyController.EnterGameArea怎么用?C# EnemyController.EnterGameArea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EnemyController
的用法示例。
在下文中一共展示了EnemyController.EnterGameArea方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SpawnEnemy
void SpawnEnemy()
{
if (currentEnemy != null)
{
Debug.LogWarning("Trying to spawn a second enemy to scene!");
}
EnemyConfig enemyToSpawn = currentState.Enemy;
switch (enemyToSpawn.Type)
{
case EnemyType.DRAGON:
Debug.Log("Spawning Dragon");
currentEnemy = GameObject.Instantiate(dragonPrefab1).GetComponent<EnemyController>();
break;
case EnemyType.DRAGON2:
Debug.Log("Spawning Dragon");
currentEnemy = GameObject.Instantiate(dragonPrefab1).GetComponent<EnemyController>();
break;
case EnemyType.LIZARD:
Debug.Log("Spawning Lizard");
currentEnemy = GameObject.Instantiate(lizardPrefab1).GetComponent<EnemyController>();
break;
case EnemyType.LIZARD2:
Debug.Log("Spawning Lizard");
currentEnemy = GameObject.Instantiate(lizardPrefab1).GetComponent<EnemyController>();
break;
case EnemyType.BOSS:
Debug.Log("Spawning Boss");
currentEnemy = GameObject.Instantiate(bossPrefab1).GetComponent<EnemyController>();
break;
case EnemyType.BOSS2:
Debug.Log("Spawning Boss");
currentEnemy = GameObject.Instantiate(bossPrefab1).GetComponent<EnemyController>();
break;
case EnemyType.IMP:
Debug.Log("Spawning Imp Boss");
currentEnemy = GameObject.Instantiate(defaultEnemyPrefab).GetComponent<EnemyController>();
break;
default:
Debug.LogWarning(string.Format("Couldn't find enemy type {0}", enemyToSpawn.Type));
break;
}
currentEnemy.Config = enemyToSpawn;
currentEnemy.OnSequenceChanged += EnemyController_OnSequenceChanged;
currentEnemy.OnEnemyDefeated += CurrentEnemy_OnEnemyDefeated;
currentEnemy.EnterGameArea();
}