public static void Reset() { LuaAnimClipModel.Reset(); LuaEffectConfModel.Reset(); ResetDrawHitData(); if (m_model != null) { Object.DestroyImmediate(m_model); m_model = null; } if (m_rightWeapon != null) { Object.DestroyImmediate(m_rightWeapon); m_rightWeapon = null; } if (m_leftWeapon != null) { Object.DestroyImmediate(m_leftWeapon); m_leftWeapon = null; } m_modelAnimation = null; m_rightWeaponAnimation = null; m_leftWeaponAnimation = null; m_dicIDEffectObject.Clear(); m_dicIDEffects.Clear(); m_dicIDObjectNameDelay.Clear(); m_dicIDEffectAnimation.Clear(); }
private static void SetAnimation(ref BaseAnimation animation, bool isGeneric, GameObject gameObject) { if (isGeneric) { Animator animator = gameObject.GetComponent <Animator>(); if (animator == null) { Debug.LogError("Prefab's animator is not exit, prefab name " + gameObject.name); } if (animation is SkillAnimator) { animation.Init(animator); } else { animation = new SkillAnimator(animator); } } else { if (animation is SkillClip) { animation.Init(gameObject); } else { animation = new SkillClip(gameObject); } } }
private static void SetWeaponAnimation(bool isRight) { GameObject weapon = isRight ? m_rightWeapon : m_leftWeapon; if (weapon == null) { if (isRight) { m_rightWeaponAnimation = null; } else { m_leftWeaponAnimation = null; } return; } BaseAnimation animation = null; if (WeaponModel.CheckModelHasWeaponClip(ModelDataModel.ModelName, weapon.name)) { SetAnimation(ref animation, WeaponModel.GetGenericState(ModelDataModel.ModelName, weapon.name), weapon); } else { animation = null; } if (isRight) { m_rightWeaponAnimation = animation; } else { m_leftWeaponAnimation = animation; } }
public static bool GenericState() { if (m_aniamtionClips == null) { return(false); } AnimationClip sampleClip = m_aniamtionClips[0]; return(BaseAnimation.IsGenericState(sampleClip)); }
public static bool GetGenericState(string modelName, string weaponName) { Dictionary <string, AnimationClip> dicClip = m_dicModelClip[modelName][weaponName]; AnimationClip sampleClip = null; foreach (var keyValue in dicClip) { sampleClip = keyValue.Value; break; } return(BaseAnimation.IsGenericState(sampleClip)); }
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); }