public void SetCurrentAniType(eCharAnimationType sourceanitype, float fBlendTime)
    {
        if (!NrCharAnimation.IsForcePlayAnimation(sourceanitype) && this.m_eCurrentAniType == sourceanitype && this.IsSameAniPlaying())
        {
            return;
        }
        AnimationClip animationClip = this.m_pkParent3DChar.SetAnimation(sourceanitype, fBlendTime, this.IsLoopAnimation(sourceanitype));

        if (animationClip == null)
        {
            if (this.m_pkParent3DChar is Nr3DCharActor)
            {
                string text = "[" + sourceanitype.ToString() + "] Character Animation Setting failed. Contact me(SSH).";
                NrTSingleton <NrWebAlert> .Instance.PushMsg(text);

                Debug.Log(text);
            }
            return;
        }
        this.m_bLoop = (animationClip.wrapMode == WrapMode.Loop);
        string value = this.m_pkParent3DChar.MakeAnimationKey(sourceanitype);

        if (!animationClip.name.Equals(value))
        {
            sourceanitype = this.FindAniTypeByCode(this.m_pkParent3DChar.GetCurrentAniType());
        }
        this.m_ePrevAniType    = this.m_eCurrentAniType;
        this.m_eCurrentAniType = sourceanitype;
        this._SetCurrentAniState(sourceanitype);
        this.m_bProcessStatus = false;
        this.SetFinishAnimation(false);
        this.m_fAniPlayingTime  = 0f;
        this.m_fAnimationLength = animationClip.length;
        if (!this.m_pkParent3DChar.IsBattleChar())
        {
            NkCharPartControl parentCharPartControl = this.m_pkParent3DChar.GetParentCharPartControl();
            if (parentCharPartControl != null)
            {
                eCharAnimationType prevAniType = this.GetPrevAniType();
                bool flag  = NrCharAnimation.IsBattleAnimation(prevAniType);
                bool flag2 = NrCharAnimation.IsBattleAnimation(sourceanitype);
                if (flag != flag2)
                {
                    parentCharPartControl.ChangeWeaponTarget();
                }
            }
        }
    }
Beispiel #2
0
 public NrCharUser()
 {
     this.m_kPersonInfo  = new NrPersonInfoUser();
     this.m_kPartControl = new NkCharPartControl();
 }