本文整理汇总了C#中Base.TakeDamage方法的典型用法代码示例。如果您正苦于以下问题:C# Base.TakeDamage方法的具体用法?C# Base.TakeDamage怎么用?C# Base.TakeDamage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Base
的用法示例。
在下文中一共展示了Base.TakeDamage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BaseBattleAnimations
private IEnumerator BaseBattleAnimations(Base enemy)
{
Animating = true;
GameController.Instance.SetBattleCamera(this.gameObject.transform.position, enemy.gameObject.transform.position);
float t = 0;
while (t <= 1.0f)
{
t += Time.fixedDeltaTime;
StartCoroutine(LookAtPosition(this, enemy.transform.position, 0.15f));
yield return new WaitForEndOfFrame(); // Leave the routine and return here in the next frame
}
PlaySound("Attack");
t = 0;
Animator animatorA = this.GetComponent<Animator>();
while (t <= 1.0f)
{
t += Time.fixedDeltaTime; // Goes from 0 to 1, incrementing by step each time
animatorA.Play("Attack");
animatorA.speed = 2f;
yield return new WaitForEndOfFrame(); // Leave the routine and return here in the next frame
}
enemy.TakeDamage(this.AttackValue);
enemy.PlaySound("TakeDamage");
animatorA.Play("Idle");
GameController.Instance.EnableMainCamera();
Animating = false;
EndTurnPanel.Instance.EnableEndTurnButton(true);
}