Esempio n. 1
0
    public void AnimationSetup()
    {
        if (MoveCo != null)
        {
            StopCoroutine(MoveCo);
        }
        ResetPos();
        CharacterAnimationStateType nextAnim = (CharacterAnimationStateType)Enum.Parse(typeof(CharacterAnimationStateType), AnimToUse.options[AnimToUse.value].text);

        CurrentSpeed = 1 * AnimationSpeed.value;
        currentCharacter.SpineAnim.SetAnimationSpeed(CurrentSpeed);
        currentCharacter.CharInfo.BaseSpeed = CurrentSpeed;
        if (nextAnim.ToString().Contains("Atk"))
        {
            currentCharacter.GetAttack();
        }

        if (nextAnim.ToString().Contains("Dash"))
        {
            MoveCo = MoveChar((InputDirection)Enum.Parse(typeof(InputDirection), nextAnim.ToString().Substring(4)));
            StartCoroutine(MoveCo);
            return;
        }
        currentCharacter.SpineAnim.SetAnim(nextAnim, Loop.isOn, TransitionTime.value);
    }
Esempio n. 2
0
 public float GetAnimLenght(CharacterAnimationStateType anim)
 {
     if (skeletonAnimation.Skeleton.Data.FindAnimation(anim.ToString()) != null)
     {
         return(skeletonAnimation.Skeleton.Data.FindAnimation(anim.ToString()).Duration);
     }
     return(1);
 }
Esempio n. 3
0
    public void SetAnim(CharacterAnimationStateType anim, bool loop, float transition)
    {
        if (anim == CharacterAnimationStateType.Atk1_IdleToAtk)
        {
            //Debug.Log("Arriving start");
        }
        Loop = loop;
        //Debug.Log(anim.ToString());

        SpineAnimationState.SetAnimation(0, anim.ToString(), loop).MixDuration = transition;
        //StartCoroutine(ClearAnim(transition));
        CurrentAnim = anim.ToString();
    }
Esempio n. 4
0
    public void SetAnim(CharacterAnimationStateType anim)
    {
        if (CurrentAnim == CharacterAnimationStateType.Death.ToString() && anim.ToString() != CharacterAnimationStateType.Idle.ToString())
        {
            return;
        }

        if (anim == CharacterAnimationStateType.Arriving || anim.ToString().Contains("Growing"))
        {
            SetAnim(anim, false, 0);
        }
        else
        {
            SetAnim(anim, anim == CharacterAnimationStateType.Death || anim == CharacterAnimationStateType.Idle ? true : false, AnimationTransition);
        }
    }
Esempio n. 5
0
    public override void SetAnimation(CharacterAnimationStateType animState, bool loop = false, float transition = 0)
    {
        Debug.Log(animState.ToString());
        SpineAnim.AnimationTransition = 1;
        switch (animState)
        {
        case (CharacterAnimationStateType.Idle):
            transition = 0.5f;
            break;

        case (CharacterAnimationStateType.Atk1_IdleToAtk):
            transition = 0f;
            break;

        case (CharacterAnimationStateType.Idle_Disable_Loop):
            transition = 1f;
            break;

        case (CharacterAnimationStateType.Death_Prep):
            transition = 1f;
            break;

        case (CharacterAnimationStateType.Atk1_AtkToIdle):
            transition = 0.5f;
            break;

        case (CharacterAnimationStateType.Atk1_Charging):
            transition = 0.4f;
            break;

        default:
            break;
        }
        base.SetAnimation(animState, loop, transition);
    }
Esempio n. 6
0
 private void Update()
 {
     if (changeanim)
     {
         changeanim = false;
         SetAnim(NextAnim.ToString(), false, transition);
     }
 }
Esempio n. 7
0
 public override void SetAnimation(CharacterAnimationStateType animState, bool loop = false, float transition = 0)
 {
     if (animState.ToString().Contains("Dash"))
     {
         animState = CharacterAnimationStateType.Idle;
         loop      = true;
     }
     base.SetAnimation(animState, loop, transition);
 }
Esempio n. 8
0
 public override void SetAnimation(CharacterAnimationStateType animState, bool loop = false, float transition = 0)
 {
     SetAnimation(animState.ToString(), loop, transition);
 }