Example #1
0
 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);
         }
     }
 }