本文整理汇总了C#中EnemyController.IsDead方法的典型用法代码示例。如果您正苦于以下问题:C# EnemyController.IsDead方法的具体用法?C# EnemyController.IsDead怎么用?C# EnemyController.IsDead使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EnemyController
的用法示例。
在下文中一共展示了EnemyController.IsDead方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTriggerEnter2D
void OnTriggerEnter2D(Collider2D coll)
{
if(coll.gameObject.tag == "Easy" || coll.gameObject.tag == "Medium" || coll.gameObject.tag == "Hard")
{
enemyController = coll.gameObject.GetComponent<EnemyController>();
if(coll.gameObject.transform.position.y <= 5)
{
bool isDead = enemyController.IsDead();
if (!isDead)
{
Destroy(gameObject);
enemyController.DoDamage(1);
}
else
{
return;
}
}
}
else if (coll.gameObject.tag == "Boss1" || coll.gameObject.tag == "Boss2" || coll.gameObject.tag == "Boss3" || coll.gameObject.tag == "Boss4" || coll.gameObject.tag == "Boss5")
{
bossController = coll.gameObject.GetComponent<BossController>();
if(coll.gameObject.transform.position.y <= 5)
{
bool isDead = bossController.IsDead();
if(!isDead)
{
Destroy(gameObject);
bossController.DoDamage(1);
}
else
{
return;
}
}
}
}
示例2: OnTriggerEnter2D
void OnTriggerEnter2D(Collider2D coll)
{
if(this.transform.position.y <= 5f)
{
if(coll.gameObject.tag == "Easy" || coll.gameObject.tag == "Medium" || coll.gameObject.tag == "Hard")
{
enemyController = coll.gameObject.GetComponent<EnemyController>();
bool isDead = enemyController.IsDead();
if (!isDead && coll.transform.position.y <= 5f)
{
enemyController.KillEnemyNoBonus();
KillMeteor();
}
else
{
return;
}
}
else if(coll.gameObject.tag == "Player" || coll.gameObject.tag == "StarbaseShield")
{
KillMeteorNoPoints();
}
if(coll.gameObject.tag == "Laser")
{
DamageMeteor();
Destroy(coll.gameObject);
}
else if(coll.gameObject.tag == "Starbase")
{
starbaseController = coll.gameObject.GetComponentInParent<StarbaseController>();
starbaseController.StarbaseDamage(2);
KillMeteorNoPoints();
}
}
}
示例3: OnTriggerEnter2D
void OnTriggerEnter2D(Collider2D coll)
{
if(coll.gameObject.tag == "Easy" || coll.gameObject.tag == "Medium" || coll.gameObject.tag == "Hard")
{
enemyController = coll.gameObject.GetComponent<EnemyController>();
bool isDead = enemyController.IsDead();
if (!isDead)
{
enemyController.KillEnemy();
KillPlayer();
}
else
{
return;
}
}
else if (coll.gameObject.tag == "BrownMeteor" || coll.gameObject.tag == "GreyMeteor" || coll.gameObject.tag == "boss1" || coll.gameObject.tag == "boss2" || coll.gameObject.tag == "boss3" || coll.gameObject.tag == "boss4" || coll.gameObject.tag == "boss5")
{
KillPlayer();
}
}