// Use this for initialization void Start() { wcAnimation = WCAnimationManager.GetAnimation(animationID); fpsTarget = 1.0f / (float)fps; animationOutput.sprite = wcAnimation.GetAnimationSprites()[0]; animationOutput.preserveAspect = true; }
// Use this for initialization void Start() { wcAnimation = WCAnimationManager.GetAnimation(animationID); fpsTarget = 1.0f / (float)fps; OnStart(); UpdateFrame(wcAnimation.GetAnimationSprites()[0]); }
public static WCAnimation GetAnimation(AnimationEnum animationID) { if (animations.ContainsKey(animationID)) { return(animations[animationID]); } else { //Load data for animation WCAnimationData data = wcAnimationData[animationID]; Texture2D[] wcAnimation = Resources.LoadAll <Texture2D>(data.path); Texture2D firstFrame = null; if (!string.IsNullOrEmpty(data.optionalFirstFramePath)) { firstFrame = Resources.Load <Texture2D>(data.optionalFirstFramePath); } //Create animation WCAnimation animation = new WCAnimation(wcAnimation, data.additiveComporession, data.basedOnFirstFrame, firstFrame); animations.Add(animationID, animation); return(animation); } }