public void GroupList() { groups = new ReorderableList(SceneViewPlus.groupsList, typeof(List <SceneViewPlus.GroupSlot>)); groups.drawHeaderCallback = (Rect rect) => { GUI.Label(rect, "Object Group"); }; groups.onChangedCallback = (ReorderableList list) => { SceneViewPlus.Repaint(); SceneViewPlus.SaveData(); }; groups.onAddCallback = (ReorderableList list) => { SceneViewPlus.SaveCurrentGroup(); GUI.FocusControl("Group Name"); groups.index = groups.count - 1; }; groups.onRemoveCallback = (ReorderableList list) => { ReorderableList.defaultBehaviours.DoRemoveButton(list); SceneViewPlus.SaveData(); SceneViewPlus.Repaint(); }; groups.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) => { if (current.clickCount >= 2) { if (rect.Contains(current.mousePosition)) { SceneViewPlus.LoadGroup(index); EditorApplication.RepaintHierarchyWindow(); current.Use(); } } DrawStrip(rect, index); rect.y += 2.0f; GUI.Label(rect, SceneViewPlus.groupsList[index].name); Rect button = new Rect(rect) { position = new Vector2(position.width - 45.0f, rect.y), size = new Vector2(18.0f, 18.0f) }; SceneViewPlus.groupsList[index].label %= 8; Texture2D icon = labels[SceneViewPlus.groupsList[index].label]; if (GUI.Button(button, new GUIContent(icon, "Group Icon"), GUI.skin.label)) { SceneViewPlus.groupsList[index].label++; SceneViewPlus.SaveData(); } }; }
public void SlotList() { slots = new ReorderableList(SceneViewPlus.slotsList, typeof(List <SceneViewPlus.ViewSlot>)); slots.drawHeaderCallback = (Rect rect) => { GUI.Label(rect, "SceneView"); }; slots.onChangedCallback = (ReorderableList list) => { SceneViewPlus.Repaint(); SceneViewPlus.SaveData(); }; slots.onAddCallback = (ReorderableList list) => { SceneViewPlus.SaveCurrentView(); GUI.FocusControl("SaveName"); slots.index = slots.count - 1; }; slots.onRemoveCallback = (ReorderableList list) => { ReorderableList.defaultBehaviours.DoRemoveButton(list); SceneViewPlus.SaveData(); SceneViewPlus.Repaint(); }; slots.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) => { if (current.clickCount >= 2) { if (rect.Contains(current.mousePosition)) { SceneViewPlus.LoadView(index); current.Use(); } } DrawStrip(rect, index); rect.y += 2; GUI.Label(new Rect(rect), SceneViewPlus.slotsList[index].name); // GUI.Label(new Rect(rect.x, rect.y, rect.width, rect.height), SceneViewPlus.slotsList[index].name); }; }