// Use this for initialization public static AnimationsUVLoader GetInstance() { if (instance == null) { instance = new AnimationsUVLoader(); } return(instance); }
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; } }
// Use this for initialization void Awake() { instance = this; AnimationsUVLoader.GetInstance().Init(); }
public int GetFrameCount(AnimationsUVLoader.AnimationType animType) { return(AnimationsUVLoader.GetInstance().GetAnimationDetails(animType).uv.Count); }