예제 #1
0
    // Use this for initialization
    void Start()
    {
        wcAnimation = WCAnimationManager.GetAnimation(animationID);

        fpsTarget = 1.0f / (float)fps;

        animationOutput.sprite         = wcAnimation.GetAnimationSprites()[0];
        animationOutput.preserveAspect = true;
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        wcAnimation = WCAnimationManager.GetAnimation(animationID);

        fpsTarget = 1.0f / (float)fps;

        OnStart();

        UpdateFrame(wcAnimation.GetAnimationSprites()[0]);
    }
예제 #3
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);
        }
    }