public override void OnExit()
 {
     if (this.mecanim != null)
     {
         UnityEngine.Object.Destroy(this.mecanim);
         this.mecanim = null;
     }
 }
示例#2
0
 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;
     }
 }
示例#4
0
    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);
    }