public override void OnExit() { if (this.mecanim != null) { UnityEngine.Object.Destroy(this.mecanim); this.mecanim = null; } }
public Skill_Jinkesi_01(string skill_id, Units self) : base(skill_id, self) { if (this.mecanim == null) { this.mecanim = this.unit.animController.GetMecanim(); } this.task = GlobalObject.Instance.StartCoroutine(this.UpdateAnim()); }
public override void OnCreate() { base.OnCreate(); this.mecanim = this.self.mMecanim; if (this.mecanim != null && this.mecanim.animator != null) { this.mecanim.animator.applyRootMotion = false; } }
public static Mecanim AddAnimationBase(Transform character) { Mecanim mecanim = null; Animator componentInChildren = character.GetComponentInChildren <Animator>(); if (componentInChildren != null) { mecanim = character.gameObject.GetComponent <Mecanim>(); if (mecanim == null) { mecanim = character.gameObject.AddComponent <Mecanim>(); } } return(mecanim); }