Update() 공개 메소드

public Update ( ) : void
리턴 void
        void Update()
        {
            if (skeletonAnimation.enabled)
            {
                skeletonAnimation.enabled = false;
            }

            accumulatedTime += Time.deltaTime;

            float frames = 0;

            while (accumulatedTime >= frameDeltaTime)
            {
                frames++;
                if (frames > maxFrameSkip)
                {
                    break;
                }
                accumulatedTime -= frameDeltaTime;
            }

            if (frames > 0)
            {
                skeletonAnimation.Update(frames * frameDeltaTime);
                requiresNewMesh = true;
            }
        }
예제 #2
0
    static int Update(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1 && TypeChecker.CheckTypes(L, 1, typeof(Spine.Unity.SkeletonAnimation)))
            {
                Spine.Unity.SkeletonAnimation obj = (Spine.Unity.SkeletonAnimation)ToLua.ToObject(L, 1);
                obj.Update();
                return(0);
            }
            else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(Spine.Unity.SkeletonAnimation), typeof(float)))
            {
                Spine.Unity.SkeletonAnimation obj = (Spine.Unity.SkeletonAnimation)ToLua.ToObject(L, 1);
                float arg0 = (float)LuaDLL.lua_tonumber(L, 2);
                obj.Update(arg0);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: Spine.Unity.SkeletonAnimation.Update"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
 static int Update(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         Spine.Unity.SkeletonAnimation obj = (Spine.Unity.SkeletonAnimation)ToLua.CheckObject <Spine.Unity.SkeletonAnimation>(L, 1);
         float arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
         obj.Update(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
        void Update()
        {
            if (skeletonAnimation.enabled)
            {
                skeletonAnimation.enabled = false;
            }

            accumulatedTime += Time.deltaTime;

            float frames = 0;

            while (accumulatedTime >= frameDeltaTime)
            {
                frames++;
                if (frames > maxFrameSkip)
                {
                    break;
                }
                accumulatedTime -= frameDeltaTime;
            }

            if (frames > 0)
            {
                if (keyframe >= wait.Length)
                {
                    //time -= wait[keyframe - 1] * (1f / 60f);
                    time    -= skeletonAnimation.AnimationState.GetCurrent(0).Animation.Duration;
                    keyframe = 0;
                }

                if (time >= wait[keyframe] * (1f / 60f))
                {
                    keyframe++;
                    txt.text = keyframe.ToString();
                }

                skeletonAnimation.Update(frames * frameDeltaTime * timescale);
                requiresNewMesh = true;

                time += frames * frameDeltaTime * timescale;
            }
        }