Skip to content

Instantly share code, notes, and snippets.

@wallstop
Created October 29, 2017 18:25
Show Gist options
  • Save wallstop/cf2748ef050cdec1b91e9036ff3c9ea8 to your computer and use it in GitHub Desktop.
Save wallstop/cf2748ef050cdec1b91e9036ff3c9ea8 to your computer and use it in GitHub Desktop.
/// <summary>
/// Triggers an attack, turning the damage area on and then off
/// </summary>
/// <returns>The weapon attack.</returns>
protected virtual IEnumerator MeleeWeaponAttack()
{
if (_attackInProgress) { yield break; }
_attackInProgress = true;
yield return new WaitForSeconds(InitialDelay);
EnableDamageArea();
yield return new WaitForSeconds(ActiveDuration);
DisableDamageArea();
_attackInProgress = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment