Example #1
0
    // Use this for initialization
    public static AnimationsUVLoader GetInstance()
    {
        if (instance == null)
        {
            instance = new AnimationsUVLoader();
        }

        return(instance);
    }
Example #2
0
    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;
        }
    }
Example #3
0
 // Use this for initialization
 void Awake()
 {
     instance = this;
     AnimationsUVLoader.GetInstance().Init();
 }
Example #4
0
 public int GetFrameCount(AnimationsUVLoader.AnimationType animType)
 {
     return(AnimationsUVLoader.GetInstance().GetAnimationDetails(animType).uv.Count);
 }