private void OnPathFinished(bool status) { _spriteRenderer.color = _defaultColor; OnAttackFinished?.Invoke(); PathCompleted?.Invoke(); }
public void TargetReached() { Destroy(this.currentBall); currentBall = null; CurrentTarget.ReceiveDamage(this, GetComponent <UnitAttributes>().GetAttributeValue(Attribute.Attack)); OnAttackFinished.Invoke(); }
private void HandleUnitAttacking(GameTime gameTime) { actionAnimationRemaining += gameTime.ElapsedGameTime.Milliseconds; if (actionAnimationRemaining > ACTION_ANIMATION_SPEED) { actionAnimationRemaining -= ACTION_ANIMATION_SPEED; currentSpriteRectangle = UnitData.UnitAnimation.GetNextAnimation(AnimationType.Attack, true); if (currentSpriteRectangle == Rectangle.Empty) { currentSpriteRectangle = UnitData.UnitAnimation.Animations[AnimationType.Waiting][0]; OnAttackFinished?.Invoke(this, EventArgs.Empty); } } }