コード例 #1
0
    public bool automatic; //TODO for auto play

    void Start()
    {
        scrubber      = GetComponent <Scrubber>();
        animationTime = 0;
        ManualPlay();
        foreach (AnimationClip clip in anim.runtimeAnimatorController.animationClips)
        {
            allAnimations.Add(clip);
        }
        currentAnimationName = allAnimations[0].name;
        scrubber.UpdateMaxAnimTime(allAnimations[0].length * loopCount);
    }
コード例 #2
0
 public void UpdateAnimationTime(string newName, int newLoopCount)
 {
     currentAnimationName = newName;
     loopCount            = newLoopCount;
     foreach (AnimationClip clip in allAnimations)
     {
         if (clip.name == currentAnimationName)
         {
             animationTotalLength = clip.length;
             scrubber.UpdateMaxAnimTime(animationTotalLength * loopCount);
         }
     }
 }