public void PlayAnimation(AnimationsUVLoader.AnimationType animType, PlayType type, float playdelay = 0.1f)
    {
        playDelay = playdelay;

        if (animationType != animType || isReadyToPlay)
        {
            SetAnimPlayState(type);
            animationDetails    = AnimationsUVLoader.GetInstance().GetAnimationDetails(animType);
            animationType       = animType;
            animationFrameIndex = 0;
            pauseAtFrame_num    = -1;
            stopAtFrame_num     = -1;

            GetComponent <Renderer>().material.mainTextureOffset = animationDetails.uv[animationFrameIndex];
            GetComponent <Renderer>().material.mainTextureScale  = animationDetails.size;
        }
    }
 public int GetFrameCount(AnimationsUVLoader.AnimationType animType)
 {
     return(AnimationsUVLoader.GetInstance().GetAnimationDetails(animType).uv.Count);
 }
Exemple #3
0
 public AnimationDetails GetAnimationDetails(AnimationsUVLoader.AnimationType animationId)
 {
     return(animationDetails[(int)animationId]);
 }