public void Attack() { onCooldown = true; int index; AttackAnimationDeprecated attackAnim = Rand.PickOne(hitAnimations, out index); CurrentAnimation = attackAnim; attackAnim.PlayAnimation(this, sword, delegate { OnAttackOver(index); swordHitBox.enabled = false; }); this.DoDelayed(attackAnim.colliderActivateDelay, delegate { swordHitBox.enabled = true; }); this.DoDelayed(hitCooldown, delegate { onCooldown = false; }); OnStartAttack(index); }
public static AttackAnimationDeprecated PlayTransitionTo(MonoBehaviour source, Vector3 localPosition, Vector3 localEuler, float time) { AttackAnimationDeprecated animation = new AttackAnimationDeprecated(); animation.animations = new List <SceneAnimationPart>() { new SceneAnimationPart() { localEuler = localEuler, localPosition = localPosition, timeNeeded = time } }; animation.PlayAnimation(source); return(animation); }