Esempio n. 1
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;
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
        public void CombinedUpdate()
        {
            if (!this || !Data)
            {
                return;
            }

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

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

            PlaytimePainter uiPainter = null;

            MeshManager.CombinedUpdate();

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

#if UNITY_2018_1_OR_NEWER
            foreach (var j in blitJobsActive)
            {
                if (j.jobHandle.IsCompleted)
                {
                    j.CompleteJob();
                }
            }
#endif

            var l = PlaytimePainter.PlaybackPainters;

            if (l.Count > 0 && !StrokeVector.pausePlayback)
            {
                if (!l.Last())
                {
                    l.RemoveLast(1);
                }
                else
                {
                    l.Last().PlaybackVectors();
                }
            }

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

            if (!uiPainter || !uiPainter.CanPaint())
            {
                var p = PlaytimePainter.currentlyPaintedObjectPainter;

                if (p && !Application.isPlaying && sinceLastPainterCall > 0.016f)
                {
                    if (p.ImgMeta == null)
                    {
                        PlaytimePainter.currentlyPaintedObjectPainter = null;
                    }
                    else
                    {
                        TexMgmtData.brushConfig.Paint(p.stroke, p);
                        p.ManagedUpdate();
                    }
                }
            }

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

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

            sinceLastPainterCall += Time.deltaTime;
        }