Beispiel #1
0
    // method
    // Standard method
    protected virtual void Awake()
    {
        enemyManager     = EnemyManager.Instance;
        inventoryManager = InventoryManager.Instance;
        lifeStoneManager = LifeStoneManager.Instance;
        animator         = GetComponent <Animator>();

        DebuffState _temp = DebuffState.Off;

        debuffState = new DebuffState[(int)EnemyDebuffCase.END_POINTER] {
            _temp, _temp, _temp, _temp, _temp
        };

        AnimationClip[] clips = animator.runtimeAnimatorController.animationClips;
        foreach (var clip in clips)
        {
            if (clip.name.Contains("Stunned"))
            {
                stunnedAnimLength = clip.length;
            }
        }

        Array.Sort(knockbackPercentage);
        Array.Reverse(knockbackPercentage);
    }
Beispiel #2
0
    public void SetState(DebuffState state)
    {
        if (currentState != null)
        {
            currentState.OnStateExit();
        }

        currentState = state;

        if (currentState != null)
        {
            currentState.OnStateEnter();
        }
    }
Beispiel #3
0
 private void Awake()
 {
     currentState = new NoBadState(this);
 }