public override void OnInspectorGUI() { base.OnInspectorGUI(); if (Application.isPlaying) { return; } Event e = Event.current; PrefabCollection myTarget = (PrefabCollection)target; PrefabCollectionUtility.UpdatePrefabCollection(myTarget); if (myTarget.prefabs == null || myTarget.prefabs.Count == 0) { EditorGUILayout.LabelField("Please add some prefab collections", EditorStyles.boldLabel); return; } if (e.type == EventType.ScrollWheel) { myTarget.Step(PrefabCollectionUtility.GetScrollStep(e)); } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); if (Application.isPlaying) { return; } CollectionGroup myTarget = (CollectionGroup)target; DrawChildren(myTarget); EditorGUILayout.Space(); //Children EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("All Children"); if (GUILayout.Button("<-", GUILayout.ExpandWidth(false))) { myTarget.Step(-1); } if (GUILayout.Button("->", GUILayout.ExpandWidth(false))) { myTarget.Step(1); } if (GUILayout.Button("?", GUILayout.ExpandWidth(false))) { myTarget.Randomize(); } EditorGUILayout.EndHorizontal(); //Scrolling if (Event.current.type == EventType.ScrollWheel) { myTarget.Step(PrefabCollectionUtility.GetScrollStep(Event.current)); } }