private void ResetPath(RepaintMode repaintMode)
 {
     this._src.wps.Clear();
     this._src.lastSrcPosition = this._src.transform.position;
     this._src.path            = new Path(this._src.pathType, this._src.wps.ToArray(), 10, new Color?(this._src.pathColor));
     this._wpsByDepth.Clear();
     this.ResetIndexes();
     this.DORepaint(repaintMode, false);
 }
示例#2
0
 private void RefreshPath(RepaintMode repaintMode, bool refreshWpIndexByDepth)
 {
     if (this._src.wps.Count >= 1)
     {
         this._src.path.AssignDecoder(this._src.pathType);
         this._src.path.AssignWaypoints(this._src.GetFullWps(), false);
         this._src.path.FinalizePath(this._src.isClosedPath, AxisConstraint.None, this._src.transform.position);
         if (this._src.pathType != 0)
         {
             Path.RefreshNonLinearDrawWps(this._src.path);
         }
         this.DORepaint(repaintMode, refreshWpIndexByDepth);
     }
 }
        public static void SwitchPanelRepaintMode(IPanel panel, RepaintMode newMode)
        {
            if (GetPanelRepaintMode(panel) != newMode)
            {
                var p = panel as Panel;
                if (newMode == RepaintMode.UIR)
                {
                    p.SetUpdater(new UIRRepaintUpdater(), VisualTreeUpdatePhase.Repaint);
                    p.SetUpdater(new UIRLayoutUpdater(), VisualTreeUpdatePhase.Layout);
                }
                else
                {
                    // Put back the standard updater
                    p.SetUpdater(new VisualTreeRepaintUpdater(), VisualTreeUpdatePhase.Repaint);
                    p.SetUpdater(new VisualTreeLayoutUpdater(), VisualTreeUpdatePhase.Layout);
                }

                panel.visualTree.MarkDirtyRepaint();
            }
        }
        private void DORepaint(RepaintMode repaintMode, bool refreshWpIndexByDepth)
        {
            switch (repaintMode)
            {
            case RepaintMode.Scene:
                SceneView.RepaintAll();
                break;

            case RepaintMode.Inspector:
                EditorUtility.SetDirty(this._src);
                break;

            case RepaintMode.SceneAndInspector:
                EditorUtility.SetDirty(this._src);
                SceneView.RepaintAll();
                break;
            }
            if (refreshWpIndexByDepth)
            {
                this.FillWpIndexByDepth();
            }
        }