本文整理汇总了C#中AttackData.IsRanged方法的典型用法代码示例。如果您正苦于以下问题:C# AttackData.IsRanged方法的具体用法?C# AttackData.IsRanged怎么用?C# AttackData.IsRanged使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AttackData
的用法示例。
在下文中一共展示了AttackData.IsRanged方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartAttack
/// <summary>
/// Starts the attack, activating the cast if needed, playing the animation, and starting
/// timer for the attack.
/// </summary>
/// <param name="attackToStart">Attack to start.</param>
void StartAttack(AttackData attackToStart)
{
// TODO This is bad practice. When we refactor this, let's properly enapsulate
// the current attack in one of these classes.
enemy.currentAttack = attackToStart;
attackAnimation.Play (attackToStart.swingAnimation.name);
if (!attackToStart.IsRanged ()) {
attackCaster.OnHit += OnAttackHit;
attackCaster.Begin ();
trailRenderer.enabled = true;
}
attackTime.StartTimer (attackToStart.swingAnimation.length);
isAttacking = true;
}