Example #1
0
        private static void BoingManagerPostRender(Camera camera)
        {
            if (!Application.isPlaying)
            {
                return;
            }

            if (s_lastUpdateFrame != Time.frameCount)
            {
                return;
            }

            if (camera != null)
            {
                if (s_postRenderHandledCameras.Contains(camera))
                {
                    return;
                }
                else
                {
                    s_postRenderHandledCameras.Add(camera);
                }
            }

            if (s_nextRenderCallback != NextRenderCallback.PostRender)
            {
                return;
            }

            RestoreBehaviors();
            RestoreReactors();
            RestoreBones();

            // do this post-render so we have one frame to finish compute dispatches
            if (s_lastReactorFieldDispatchedFrame < Time.frameCount)
            {
                DispatchReactorFieldCompute();
                s_lastReactorFieldDispatchedFrame = Time.frameCount;
            }

            s_nextRenderCallback = NextRenderCallback.PreRender;
        }
Example #2
0
        private static void BoingManagerPreRender(Camera camera)
        {
            if (!Application.isPlaying)
            {
                return;
            }

            if (s_lastUpdateFrame != Time.frameCount)
            {
                return;
            }

            if (camera != null)
            {
                if (s_preRenderHandledCameras.Contains(camera))
                {
                    return;
                }
                else
                {
                    s_preRenderHandledCameras.Add(camera);
                }
            }

            if (s_nextRenderCallback != NextRenderCallback.PreRender)
            {
                return;
            }

            // only pull results in here if PreRender is called more than once per frame
            // initial result pulls are done in LateUpdate
            if (s_lastPreRenderUpdateFrame == Time.frameCount)
            {
                PullBehaviorResults();
                PullReactorResults();
                PullBonesResults(); // pull bones results last, so bone transforms don't inherit parent transform delta
            }
            s_lastPreRenderUpdateFrame = Time.frameCount;

            s_nextRenderCallback = NextRenderCallback.PostRender;
        }