Esempio n. 1
0
    private void OnPathFinished(bool status)
    {
        _spriteRenderer.color = _defaultColor;

        OnAttackFinished?.Invoke();
        PathCompleted?.Invoke();
    }
Esempio n. 2
0
    public void TargetReached()
    {
        Destroy(this.currentBall);
        currentBall = null;

        CurrentTarget.ReceiveDamage(this, GetComponent <UnitAttributes>().GetAttributeValue(Attribute.Attack));
        OnAttackFinished.Invoke();
    }
Esempio n. 3
0
        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);
                }
            }
        }