Example #1
0
        private static void InitModelAnimation()
        {
            AnimationModel.AnimationClips = GetAllAnimationClip();
            bool isGeneric = AnimationModel.GenericState();

            SetAnimation(ref m_modelAnimation, isGeneric, m_model);
            if (!isGeneric)
            {
                return;
            }
            string   sourcePath = Tool.FullPathToProjectPath(ModelDataModel.ControllerPath);
            Animator animator   = m_model.GetComponent <Animator>();
            var      controller = animator.runtimeAnimatorController;

            AnimatorControllerManager.RemoveAllAnimatorTransition(controller.name, sourcePath);
        }
Example #2
0
        public static void SetAnimationClipData(int index)
        {
            Stop();
            ResetDrawHitData();
            Tool.NormalizeTransform(m_model);
            AnimationModel.SetCurrentAnimationClip(index);
            LuaAnimClipModel.SetCurrentClipName(AnimationModel.SelectAnimationClipName);
            AnimationClip selectAnimationClip = AnimationModel.SelectAnimationClip;

            if (selectAnimationClip == null)
            {
                m_isNoWeaponClip       = true;
                m_rightWeaponAnimation = null;
                m_leftWeaponAnimation  = null;
                return;
            }
            m_isNoWeaponClip = !WeaponModel.CheckModelHasClip(ModelDataModel.ModelName);
            SetWeaponAnimation(true);
            SetWeaponAnimation(false);
        }