public void CombinedUpdate()
        {
            if (!this || !Data)
            {
                return;
            }

            lastManagedUpdate = QcUnity.TimeSinceStartup();

            if (PlaytimePainter.IsCurrentTool && FocusedPainter)
            {
                FocusedPainter.ManagedUpdateOnFocused();
            }

            QcAsync.UpdateManagedCoroutines();

            MeshManager.CombinedUpdate();

            if (!Application.isPlaying && depthProjectorCamera)
            {
                depthProjectorCamera.ManagedUpdate();
            }

#if UNITY_EDITOR
            if (refocusOnThis)
            {
                _scipFrames--;
                if (_scipFrames == 0)
                {
                    QcUnity.FocusOn(refocusOnThis);
                    refocusOnThis = null;
                    _scipFrames   = 3;
                }
            }
#endif

            var p = PlaytimePainter.currentlyPaintedObjectPainter;

            if (p && !Application.isPlaying && ((QcUnity.TimeSinceStartup() - lastPainterCall) > 0.016f))
            {
                if (p.TexMeta == null)
                {
                    PlaytimePainter.currentlyPaintedObjectPainter = null;
                }
                else
                {
                    p.ProcessStrokeState();
                }
            }

            var needRefresh = false;
            if (CameraModuleBase.modules != null)
            {
                foreach (var pl in CameraModuleBase.modules)
                {
                    if (pl != null)
                    {
                        pl.Update();
                    }
                    else
                    {
                        needRefresh = true;
                    }
                }
            }

            if (needRefresh)
            {
                Debug.Log("Refreshing modules");
                CameraModuleBase.RefreshModules();
            }

            lastPainterCall = QcUnity.TimeSinceStartup();
        }
Beispiel #2
0
        public void CombinedUpdate()
        {
            if (!this || !Data)
            {
                return;
            }

            lastManagedUpdate = Time.time;

            if (PlaytimePainter.IsCurrentTool && focusedPainter)
            {
                focusedPainter.ManagedUpdateOnFocused();
            }

            if (GlobalBrush.previewDirty)
            {
                SHADER_BRUSH_UPDATE();
            }

            QcAsync.UpdateManagedCoroutines();

            MeshManager.CombinedUpdate();

            if (!Application.isPlaying && depthProjectorCamera)
            {
                depthProjectorCamera.ManagedUpdate();
            }

#if UNITY_EDITOR
            if (refocusOnThis)
            {
                _scipFrames--;
                if (_scipFrames == 0)
                {
                    QcUnity.FocusOn(refocusOnThis);
                    refocusOnThis = null;
                    _scipFrames   = 3;
                }
            }
#endif

            var p = PlaytimePainter.currentlyPaintedObjectPainter;

            if (p && !Application.isPlaying && ((Time.time - lastPainterCall) > 0.016f))
            {
                if (p.TexMeta == null)
                {
                    PlaytimePainter.currentlyPaintedObjectPainter = null;
                }
                else
                {
                    p.ProcessStrokeState();
                    //TexMgmtData.brushConfig.Paint(p.stroke, p);
                    //p.ManagedUpdateOnFocused();
                }
            }

            var needRefresh = false;
            if (CameraModuleBase.modules != null)
            {
                foreach (var pl in CameraModuleBase.modules)
                {
                    if (pl != null)
                    {
                        pl.Update();
                    }
                    else
                    {
                        needRefresh = true;
                    }
                }
            }

            if (needRefresh)
            {
                Debug.Log("Refreshing modules");
                CameraModuleBase.RefreshPlugins();
            }

            lastPainterCall = Time.time;
        }