本文整理汇总了C#中IRoom.RandomEnemySpawnPt方法的典型用法代码示例。如果您正苦于以下问题:C# IRoom.RandomEnemySpawnPt方法的具体用法?C# IRoom.RandomEnemySpawnPt怎么用?C# IRoom.RandomEnemySpawnPt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRoom
的用法示例。
在下文中一共展示了IRoom.RandomEnemySpawnPt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateEnemy
public void CreateEnemy(int _enemyID, IRoom _room)
{
if (!mEnemySampleDict.ContainsKey(_enemyID))
{
Debug.Log("Can't find Enemy ID: " + _enemyID.ToString());
//找不到時產生1號
_enemyID = 1;
}
var SpawnPoint = _room.RandomEnemySpawnPt();
if (SpawnPoint == null)
{
Debug.Log(string.Format("Room {0} is full of enemy", _room.index.ToString()));
return;
}
var sample = this.mEnemySampleDict[_enemyID];
var go = sample.InstantiateTo(this.mEnemyRoot);
var enemy = go.GetComponent<IEnemy>();
// spawn
enemy.Swpan(SpawnPoint);
enemy.currentRoom = 0;
//load data from table
string EnemyID = _enemyID.ToString();
var data = new BattleData();
data.MaxHP = (long)Data.Enemy[EnemyID].MaxHP * (_room.index + 1);
data.NowHP = data.MaxHP;
data.Attack = (long)Data.Enemy[EnemyID].Attack * (_room.index + 1);
enemy.EnemyData = data;
//Debug.Log("HP: " + data.MaxHP);
//Debug.Log("Attack: " + data.Attack);
}