Exemple #1
0
        private void RespondToMessage(ToolWasSelectedMessage message)
        {
            // Note: It is possible that the user may have changed the transform of the
            //       objects while the tool was deselected, so we need to ensure that the
            //       tree is up to date.
            _gameObjectSphereTree.HandleTransformChangesForAllRegisteredObjects();

            // It may be possible that the user has added objects to the scene while the tool object
            // was deselected, so we will instruct the camera to update its visibility.
            SceneViewCamera.Instance.SetObjectVisibilityDirty();
        }
        private void OnEnable()
        {
            _octave = target as Octave3DWorldBuilder;
            _octave.OnInspectorEnabled();

            // Note: Just ensure that the Inspector will be redrawn on Undo/Redo.
            Undo.undoRedoPerformed -= Repaint;
            Undo.undoRedoPerformed += Repaint;

            // Let the world know that the tool was selected :)
            ToolWasSelectedMessage.SendToInterestedListeners();

            ToolSupervisor.Get().RemoveNullPrefabReferences();

            _octave.RepaintAllEditorWindows();
        }
        public static void SendToInterestedListeners()
        {
            var message = new ToolWasSelectedMessage();

            MessageListenerDatabase.Instance.SendMessageToInterestedListeners(message);
        }