Example #1
0
 public void OnEnable()
 {
     this.m_Editor = new LightProbeGroupEditor(this.target as LightProbeGroup);
     this.m_Editor.PullProbePositions();
     this.m_Editor.DeselectProbes();
     this.m_Editor.PushProbePositions();
     SceneView.onSceneGUIDelegate = (SceneView.OnSceneFunc)Delegate.Combine(SceneView.onSceneGUIDelegate, new SceneView.OnSceneFunc(this.OnSceneGUIDelegate));
     Undo.undoRedoPerformed       = (Undo.UndoRedoCallback)Delegate.Combine(Undo.undoRedoPerformed, new Undo.UndoRedoCallback(this.UndoRedoPerformed));
 }
		public void OnEnable()
		{
			this.m_Editor = new LightProbeGroupEditor(this.target as LightProbeGroup);
			this.m_Editor.PullProbePositions();
			this.m_Editor.DeselectProbes();
			this.m_Editor.PushProbePositions();
			SceneView.onSceneGUIDelegate = (SceneView.OnSceneFunc)Delegate.Combine(SceneView.onSceneGUIDelegate, new SceneView.OnSceneFunc(this.OnSceneGUIDelegate));
			Undo.undoRedoPerformed = (Undo.UndoRedoCallback)Delegate.Combine(Undo.undoRedoPerformed, new Undo.UndoRedoCallback(this.UndoRedoPerformed));
		}
 public void OnDisable()
 {
     EndEditProbes();
     Undo.undoRedoPerformed       -= UndoRedoPerformed;
     SceneView.onSceneGUIDelegate -= OnSceneGUIDelegate;
     if (target != null)
     {
         m_Editor.PushProbePositions();
         m_Editor = null;
     }
 }
 public void OnEnable()
 {
     m_Editor = new LightProbeGroupEditor(target as LightProbeGroup, this);
     m_Editor.PullProbePositions();
     m_Editor.DeselectProbes();
     m_Editor.PushProbePositions();
     SceneView.onSceneGUIDelegate += OnSceneGUIDelegate;
     Undo.undoRedoPerformed       += UndoRedoPerformed;
     EditMode.editModeStarted     += OnEditModeStarted;
     EditMode.editModeEnded       += OnEditModeEnded;
 }
Example #5
0
 public void OnDisable()
 {
     this.EndEditProbes();
     Undo.undoRedoPerformed       = (Undo.UndoRedoCallback)Delegate.Remove(Undo.undoRedoPerformed, new Undo.UndoRedoCallback(this.UndoRedoPerformed));
     SceneView.onSceneGUIDelegate = (SceneView.OnSceneFunc)Delegate.Remove(SceneView.onSceneGUIDelegate, new SceneView.OnSceneFunc(this.OnSceneGUIDelegate));
     if (this.target != null)
     {
         this.m_Editor.PushProbePositions();
         this.m_Editor = null;
     }
 }
 public void OnEnable()
 {
     this.m_Editor = new LightProbeGroupEditor(base.target as LightProbeGroup, this);
     this.m_Editor.PullProbePositions();
     this.m_Editor.DeselectProbes();
     this.m_Editor.PushProbePositions();
     SceneView.onSceneGUIDelegate     = (SceneView.OnSceneFunc)Delegate.Combine(SceneView.onSceneGUIDelegate, new SceneView.OnSceneFunc(this.OnSceneGUIDelegate));
     Undo.undoRedoPerformed           = (Undo.UndoRedoCallback)Delegate.Combine(Undo.undoRedoPerformed, new Undo.UndoRedoCallback(this.UndoRedoPerformed));
     EditMode.onEditModeStartDelegate = (EditMode.OnEditModeStartFunc)Delegate.Combine(EditMode.onEditModeStartDelegate, new EditMode.OnEditModeStartFunc(this.EditModeStarted));
     EditMode.onEditModeEndDelegate   = (EditMode.OnEditModeStopFunc)Delegate.Combine(EditMode.onEditModeEndDelegate, new EditMode.OnEditModeStopFunc(this.EditModeEnded));
 }
Example #7
0
        public void OnDisable()
        {
            EndEditProbes();
            Undo.undoRedoPerformed   -= UndoRedoPerformed;
            EditMode.editModeStarted -= OnEditModeStarted;
            EditMode.editModeEnded   -= OnEditModeEnded;

            if (target != null)
            {
                m_Editor.PushProbePositions();
                m_Editor = null;
            }
        }
Example #8
0
        public void OnEnable()
        {
            m_Editor = new LightProbeGroupEditor(target as LightProbeGroup);
            m_Editor.PullProbePositions();
            m_Editor.DeselectProbes();
            m_Editor.PushProbePositions();

            m_Editor.drawTetrahedra = new SavedBool($"{target.GetType()}.drawTetrahedra", true);

            Undo.undoRedoPerformed   += UndoRedoPerformed;
            EditMode.editModeStarted += OnEditModeStarted;
            EditMode.editModeEnded   += OnEditModeEnded;
        }
        public void OnDisable()
        {
            EndEditProbes();
            Undo.undoRedoPerformed   -= UndoRedoPerformed;
            SceneView.duringSceneGui -= OnSceneGUIDelegate;
            EditMode.editModeStarted -= OnEditModeStarted;
            EditMode.editModeEnded   -= OnEditModeEnded;

            if (target != null)
            {
                m_Editor.PushProbePositions();
                m_Editor = null;
            }
        }
        public bool OnSceneGUI(Transform transform)
        {
            if (!this.m_Group.enabled)
            {
                return(this.m_Editing);
            }
            if (Event.current.type == EventType.Layout)
            {
                if (this.m_LastPosition != this.m_Group.transform.position || this.m_LastRotation != this.m_Group.transform.rotation || this.m_LastScale != this.m_Group.transform.localScale)
                {
                    this.MarkTetrahedraDirty();
                }
                this.m_LastPosition = this.m_Group.transform.position;
                this.m_LastRotation = this.m_Group.transform.rotation;
                this.m_LastScale    = this.m_Group.transform.localScale;
            }
            bool firstSelect = false;

            if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && (this.SelectedCount == 0 && PointEditor.FindNearest(Event.current.mousePosition, transform, (IEditablePoint)this) != -1) && !this.m_Editing)
            {
                this.m_Editing = true;
                firstSelect    = true;
            }
            bool flag = Event.current.type == EventType.MouseUp;

            if (this.m_Editing && PointEditor.SelectPoints((IEditablePoint)this, transform, ref this.m_Selection, firstSelect))
            {
                Undo.RegisterCompleteObjectUndo(new UnityEngine.Object[2]
                {
                    (UnityEngine.Object) this.m_Group,
                    (UnityEngine.Object) this.m_SerializedSelectedProbes
                }, "Select Probes");
            }
            if (this.m_Editing && flag && this.SelectedCount == 0)
            {
                this.m_Editing = false;
                this.MarkTetrahedraDirty();
            }
            if ((Event.current.type == EventType.ValidateCommand || Event.current.type == EventType.ExecuteCommand) && Event.current.commandName == "Paste")
            {
                if (Event.current.type == EventType.ValidateCommand && LightProbeGroupEditor.CanPasteProbes())
                {
                    Event.current.Use();
                }
                if (Event.current.type == EventType.ExecuteCommand && this.PasteProbes())
                {
                    Event.current.Use();
                    this.m_Editing = true;
                }
            }
            this.DrawTetrahedra();
            PointEditor.Draw((IEditablePoint)this, transform, this.m_Selection, true);
            if (!this.m_Editing)
            {
                return(this.m_Editing);
            }
            this.HandleEditMenuHotKeyCommands();
            if (this.m_Editing && PointEditor.MovePoints((IEditablePoint)this, transform, this.m_Selection))
            {
                Undo.RegisterCompleteObjectUndo(new UnityEngine.Object[2]
                {
                    (UnityEngine.Object) this.m_Group,
                    (UnityEngine.Object) this.m_SerializedSelectedProbes
                }, "Move Probes");
                if (LightmapVisualization.dynamicUpdateLightProbes)
                {
                    this.MarkTetrahedraDirty();
                }
            }
            if (this.m_Editing && flag && !LightmapVisualization.dynamicUpdateLightProbes)
            {
                this.MarkTetrahedraDirty();
            }
            return(this.m_Editing);
        }