/// <summary> /// Triggered when the user selects a new resource or a scene object, or deselects everything. /// </summary> /// <param name="objects">A set of new scene objects that were selected.</param> /// <param name="paths">A set of absolute resource paths that were selected.</param> private void OnSelectionChanged(SceneObject[] objects, string[] paths) { if (currentType == InspectorType.SceneObject && modifyState == InspectableState.NotModified) { UndoRedo.PopCommand(undoCommandIdx); } Clear(); modifyState = InspectableState.NotModified; if (objects.Length == 0 && paths.Length == 0) { currentType = InspectorType.None; inspectorScrollArea = new GUIScrollArea(); GUI.AddElement(inspectorScrollArea); inspectorLayout = inspectorScrollArea.Layout; inspectorLayout.AddFlexibleSpace(); GUILayoutX layoutMsg = inspectorLayout.AddLayoutX(); layoutMsg.AddFlexibleSpace(); layoutMsg.AddElement(new GUILabel(new LocEdString("No object selected"))); layoutMsg.AddFlexibleSpace(); inspectorLayout.AddFlexibleSpace(); } else if ((objects.Length + paths.Length) > 1) { currentType = InspectorType.None; inspectorScrollArea = new GUIScrollArea(); GUI.AddElement(inspectorScrollArea); inspectorLayout = inspectorScrollArea.Layout; inspectorLayout.AddFlexibleSpace(); GUILayoutX layoutMsg = inspectorLayout.AddLayoutX(); layoutMsg.AddFlexibleSpace(); layoutMsg.AddElement(new GUILabel(new LocEdString("Multiple objects selected"))); layoutMsg.AddFlexibleSpace(); inspectorLayout.AddFlexibleSpace(); } else if (objects.Length == 1) { if (objects[0] != null) { UndoRedo.RecordSO(objects[0]); undoCommandIdx = UndoRedo.TopCommandId; SetObjectToInspect(objects[0]); } } else if (paths.Length == 1) { SetObjectToInspect(paths[0]); } }