Example #1
0
    public void InitAniManager(Animator _ani)
    {
        ani = _ani;
        aniAction.Add(eAniIndex.IDLE, new Idle());
        aniAction.Add(eAniIndex.RUN, new Run());
        curAction = aniAction[eAniIndex.IDLE];

        AnimatorClipInfo[] ClipInfo = ani.GetCurrentAnimatorClipInfo(0);
        strCurAni  = ClipInfo[0].clip.name;
        strNextAni = strCurAni;
    }
Example #2
0
    public void SetAnimation(string strName)
    {
        int nIndex = 0;

        //문자열과 애니메이션 파라미터를 저장한 자료구조 사용

        if (strNextAni == "idle")
        {
            nIndex = 0;
        }
        else if (strNextAni == "run")
        {
            nIndex = 1;
        }
        ani.SetInteger("inIndex", nIndex);
        curAction = aniAction[(eAniIndex)nIndex];
    }