public static Show ( SerializedProperty list, EEditorListOption options = EEditorListOption.Default ) : void | ||
list | SerializedProperty | |
options | EEditorListOption | |
return | void |
public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.PropertyField(serializedObject.FindProperty("gameSceneName"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("menuSceneName"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("uiManager"), true); EditorList.Show(serializedObject.FindProperty("breakableBrickPics"), EditorListOption.ListLabel | EditorListOption.Buttons); EditorGUILayout.PropertyField(serializedObject.FindProperty("unbreakableBrickPic"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("capsuleDropProbability"), true); EditorList.Show(serializedObject.FindProperty("capsulePrizes"), EditorListOption.ListLabel | EditorListOption.Buttons); EditorGUILayout.PropertyField(serializedObject.FindProperty("maximumLifes"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("brickPrefab"), true); string arkanoidLevelsHelpBox = "" + "This is a text-based level definition. Each line represents an Arkanoid line. For each line only 10 first chars will be taken into account." + "Type \"U\" for unbreakable bricks, \"1\" for one-hit bricks, \"2\" for two-hit bricks and \"3\" for three-hit bricks. Any other char will be interpreted as no brick."; EditorList.Show(serializedObject.FindProperty("arkanoidLevels"), EditorListOption.ListLabel | EditorListOption.Buttons, arkanoidLevelsHelpBox); EditorGUILayout.PropertyField(serializedObject.FindProperty("vBrickOffset"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("hBrickOffset"), true); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); var feathersProperty = serializedObject.FindProperty("Feathers"); EditorList.Show(feathersProperty); if (feathersProperty.isExpanded) { GUILayout.Space(20); if (GUILayout.Button("+")) { ProcessAddButton(); } } serializedObject.ApplyModifiedProperties(); ShowStats(); GUILayout.Space(20); var style = new GUIStyle(GUI.skin.button); style.normal.textColor = Color.red; if (GUILayout.Button("Clear All", style)) { ProcessClearButton(); } if (GUI.changed) { EditorUtility.SetDirty(target); UpdateIds(); } }
public override void OnInspectorGUI() { serializedObject.Update(); EditorList.Show(serializedObject.FindProperty("Waves"), "Wave"); serializedObject.ApplyModifiedProperties(); }
/* * Responsible for drawing elements in the inspector panel */ public override void OnInspectorGUI() { /* * Show all variables that we need in the inspector panel by calling the function show. The variables below are bascally all the public variables * from the Place_Objects class. To make sure that a nice title and tooltip is showing up I am passing it to function show. */ serializedObject.Update(); EditorList.Show(serializedObject.FindProperty("i_min_same_parts"), "Min. amount", "Minimum amount of elements placed straight"); EditorList.Show(serializedObject.FindProperty("i_max_same_parts"), "Max. amount", "Maximum amount of elements placed straight"); EditorList.Show(serializedObject.FindProperty("player"), "Player", "GameObject where the PlayerScript is attached to"); EditorList.Show(serializedObject.FindProperty("i_amount_of_objects_prebuilt"), "Amount of subsections", "Amount of subsections that is prebuilt"); EditorList.Show(serializedObject.FindProperty("collision_distance"), "Distance Collision", "The distance to check for collisions"); EditorList.Show(serializedObject.FindProperty("bool_place_dependency"), "Instantiate Dependency", "Don't place the dependency of the fork"); //The arrays for the different building assets EditorList.Show(serializedObject.FindProperty("parts_straight_begin"), "Begin elements", "Add all your begin elements", EditorListOption.ListLabel | EditorListOption.Buttons); EditorList.Show(serializedObject.FindProperty("parts_straight_forward"), "Elements facing forwards", "Add all your elements facing forwards", EditorListOption.ListLabel | EditorListOption.Buttons); EditorList.Show(serializedObject.FindProperty("parts_corner_right"), "Corner Elements Right", "Add all your corners facing to the right side", EditorListOption.ListLabel | EditorListOption.Buttons); EditorList.Show(serializedObject.FindProperty("parts_corner_left"), "Corner Elements Left", "Add all your corners facing to the left side", EditorListOption.ListLabel | EditorListOption.Buttons); EditorList.Show(serializedObject.FindProperty("parts_corner_fork"), "Fork elements", "Add all your fork elements", EditorListOption.ListLabel | EditorListOption.Buttons); EditorList.Show(serializedObject.FindProperty("parts_stairway"), "Stairway elements", "Add all your stairway assets", EditorListOption.ListLabel | EditorListOption.Buttons); //EditorUtility.DisplayDialog("Min-Max Error","Please change the max or the min value! "); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { //base.OnInspectorGUI(); serializedObject.Update(); Questions q = (Questions)target; GUILayout.BeginHorizontal(); GUILayout.Label("Question:", GUILayout.Width(70)); q.Question = EditorGUILayout.TextField(q.Question, GUILayout.Width(140)); q.name = q.Question; //GUILayout.EndHorizontal(); //GUILayout.BeginHorizontal(); GUILayout.Label("Answer:", GUILayout.Width(60)); q.Answer = EditorGUILayout.TextField(q.Answer, GUILayout.Width(140)); GUILayout.EndHorizontal(); GUILayout.Space(5); //EditorGUILayout.PropertyField(serializedObject.FindProperty("WrongAnswers"), true); EditorList.Show(serializedObject.FindProperty("WrongAnswers"), EditorListOption.NoElementLabels); serializedObject.ApplyModifiedProperties(); }
public void ShowSoundGroup(SoundGroup soundGroup, SerializedProperty property) { /* * EditorGUILayout.PropertyField(property.FindPropertyRelative("sounds")); * if (property.FindPropertyRelative("sounds").isExpanded) * { * EditorGUI.indentLevel += 1; * if (property.FindPropertyRelative("sounds").arraySize == 0) * { * EditorGUILayout.BeginHorizontal(); * ShowButtons(property.FindPropertyRelative("sounds"), 0); * EditorGUILayout.EndHorizontal(); * } * for (int j = 0; j < property.FindPropertyRelative("sounds").arraySize; j++) * { * EditorGUILayout.BeginHorizontal(); * EditorGUILayout.PropertyField(property.FindPropertyRelative("sounds").GetArrayElementAtIndex(j), GUIContent.none); * ShowButtons(property.FindPropertyRelative("sounds"), j); * EditorGUILayout.EndHorizontal(); * } * EditorGUI.indentLevel -= 1; * } */ EditorList.Show(property.FindPropertyRelative("sounds"), EditorListOption.NoSize); EditorGUILayout.Slider(property.FindPropertyRelative("volume"), 0, 1); EditorGUILayout.PropertyField(property.FindPropertyRelative("deadTime")); EditorGUILayout.PropertyField(property.FindPropertyRelative("randomize")); if (soundGroup.randomize) { EditorGUI.indentLevel += 1; EditorGUILayout.Slider(property.FindPropertyRelative("pitchRndValue"), 0, 1); EditorGUILayout.Slider(property.FindPropertyRelative("volumeRndValue"), 0, 1); EditorGUI.indentLevel -= 1; } EditorGUILayout.PropertyField(property.FindPropertyRelative("interruptible")); if (soundGroup.interruptible) { EditorGUI.indentLevel += 1; EditorGUILayout.PropertyField(property.FindPropertyRelative("maxSoursesCount")); EditorGUILayout.PropertyField(property.FindPropertyRelative("fadeOutTime")); EditorGUI.indentLevel -= 1; EditorGUILayout.PropertyField(property.FindPropertyRelative("loop")); if (soundGroup.loop) { EditorGUI.indentLevel += 1; EditorGUILayout.PropertyField(property.FindPropertyRelative("loopMode")); EditorGUILayout.PropertyField(property.FindPropertyRelative("maxLoopCount")); if (soundGroup.loopMode == SoundLoopMode.Crossfade) { EditorGUILayout.PropertyField(property.FindPropertyRelative("fadeStartTime")); EditorGUILayout.PropertyField(property.FindPropertyRelative("fadeDuration")); } EditorGUI.indentLevel -= 1; } } }
public override void OnInspectorGUI() { serializedObject.Update(); EditorList.Show(serializedObject.FindProperty("pools"), EditorListOption.NoListLabel); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { myTarget = (TileAssetObjects)target; serializedObject.Update(); EditorList.Show(serializedObject.FindProperty("tiles"), EditorListOption.Buttons | EditorListOption.ListLabel, EditorListButtonOption.All); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.PropertyField(serializedObject.FindProperty("showWayPoints")); EditorGUILayout.PropertyField(serializedObject.FindProperty("showWayPointHandles")); EditorList.Show(serializedObject.FindProperty("wayPoints")); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); EditorList.Show(serializedObject.FindProperty("integers"), EditorListOption.ListSize); //EditorList.Show(serializedObject.FindProperty("vectors")); EditorList.Show(serializedObject.FindProperty("colorPoints"), EditorListOption.Buttons); EditorList.Show(serializedObject.FindProperty("objects"), EditorListOption.ListLabel | EditorListOption.Buttons); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); EditorList.Show(serializedObject.FindProperty("integers")); EditorList.Show(serializedObject.FindProperty("vectors")); EditorList.Show(serializedObject.FindProperty("colorPoints")); EditorList.Show(serializedObject.FindProperty("objects")); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); EditorGUI.BeginDisabledGroup(true); EditorGUILayout.PropertyField(scriptName, true, new GUILayoutOption[0]); EditorGUI.EndDisabledGroup(); EditorList.Show(itemsCollectionUI, true); serializedObject.ApplyModifiedProperties(); }
void DrawLocalisation() { EditorGUILayout.LabelField("Localisation", EditorStyles.boldLabel); EditorGUILayout.BeginVertical("Box"); EditorGUI.indentLevel += 1; EditorList.Show(_supportedLanguagesProperty, EditorListOption.ListLabel | EditorListOption.Buttons | EditorListOption.AlwaysShowAddButton, addButtonText: "Add Language", addButtonToolTip: "Add Language"); EditorGUI.indentLevel -= 1; EditorGUILayout.EndVertical(); }
public override void OnInspectorGUI() { m_Object.Update(); GUILayout.Label("Bullet Pattern Creator", EditorStyles.boldLabel); EditorGUILayout.PropertyField(positiveProperties["timeToLive"]); EditorGUILayout.PropertyField(direction); EditorList.Show(bulletArrays); EditorGUILayout.PropertyField(positiveProperties["bulletsPerArray"]); EditorGUILayout.PropertyField(offset); GUILayout.Label("Origin"); positiveProperties["origin"].floatValue = EditorGUILayout.Slider(positiveProperties["origin"].floatValue, 0, 360); GUILayout.Label("Spawn Radius"); positiveProperties["spawnRadius"].floatValue = EditorGUILayout.Slider(positiveProperties["spawnRadius"].floatValue, 0, 100); GUILayout.Label("Array Bullet Spread"); positiveProperties["arrayBulletSpread"].floatValue = EditorGUILayout.Slider(positiveProperties["arrayBulletSpread"].floatValue, 0, 360); GUILayout.Label("Array Spread"); positiveProperties["arraySpread"].floatValue = EditorGUILayout.Slider(positiveProperties["arraySpread"].floatValue, 0, 360); EditorGUILayout.PropertyField(straightShot); EditorGUILayout.PropertyField(positiveProperties["spinSpeed"]); EditorGUILayout.PropertyField(speedChange); if (positiveProperties["spinSpeed"].floatValue == 0 && speedChange.boolValue == false) { EditorGUILayout.PropertyField(aimAtPlayer); } else { aimAtPlayer.boolValue = false; } if (speedChange.boolValue == true) { EditorGUILayout.PropertyField(positiveProperties["timeToLerp"]); EditorGUILayout.PropertyField(easeMode); EditorGUILayout.PropertyField(positiveProperties["maxSpinSpeed"]); EditorGUILayout.PropertyField(spinReversal); if (spinReversal.boolValue == true) { EditorGUILayout.PropertyField(positiveProperties["cycles"]); } } EditorGUILayout.PropertyField(positiveProperties["fireRate"]); EditorGUILayout.PropertyField(positiveProperties["bulletSpeed"]); CheckPositiveProperties(); m_Object.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); MagiaList mTest = (MagiaList)target; SerializedProperty list = serializedObject.FindProperty("magias"); EditorList.Show(list, EditorListOption.ListLabel | EditorListOption.Buttons); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); EditorList.Show(list = serializedObject.FindProperty("qualityLevels"), EditorListOption.Buttons | EditorListOption.ElementLabels); if (GUILayout.Button(new GUIContent("New Graphic Quality", "Add"), EditorStyles.miniButton, GUILayout.Height(25))) { list.arraySize += 1; } serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); EditorList.Show(headsProperty, EditorListOption.Buttons | EditorListOption.ListLabel); EditorList.Show(bodiesProperty, EditorListOption.Buttons | EditorListOption.ListLabel); EditorList.Show(legsProperty, EditorListOption.Buttons | EditorListOption.ListLabel); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.PropertyField(serializedObject.FindProperty("attribute")); EditorGUILayout.PropertyField(serializedObject.FindProperty("majorChallenge")); EditorGUILayout.PropertyField(serializedObject.FindProperty("length")); EditorGUILayout.PropertyField(serializedObject.FindProperty("difficulty")); EditorList.Show(serializedObject.FindProperty("path"), EditorListOption.NoListSize | EditorListOption.Buttons); EditorList.Show(serializedObject.FindProperty("elements"), EditorListOption.NoListSize | EditorListOption.Buttons); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.PropertyField(serializedObject.FindProperty("GroupObject")); EditorGUILayout.LabelField("Cells"); EditorList.Show(serializedObject.FindProperty("Cells"), EditorListOption.Buttons); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { SeinAtlas atlas = (SeinAtlas)target; serializedObject.Update(); EditorGUILayout.PropertyField(serializedObject.FindProperty("maxWidth")); EditorGUILayout.PropertyField(serializedObject.FindProperty("maxHeight")); EditorGUILayout.PropertyField(serializedObject.FindProperty("padding")); EditorGUILayout.PropertyField(serializedObject.FindProperty("isImageCanRelease")); var option = EEditorListOption.ListLabel | EEditorListOption.Buttons; EditorList.Show(serializedObject.FindProperty("images"), option); EditorGUILayout.PropertyField(serializedObject.FindProperty("saveAfterPack")); GUILayout.BeginHorizontal(); if (GUILayout.Button("Pack", GUILayout.Width(80), GUILayout.Height(40))) { atlas.Pack(); } GUILayout.FlexibleSpace(); if (GUILayout.Button("Save", GUILayout.Width(80), GUILayout.Height(40))) { atlas.Save(); } GUILayout.FlexibleSpace(); if (GUILayout.Button("Import", GUILayout.Width(80), GUILayout.Height(40))) { if (atlas != null && atlas.images != null && atlas.images.Length != 0) { if (EditorUtility.DisplayDialog( "This atlas is not empty", "New atlas will overwrite it !", "Continue", "Cancel" )) { DoImport(atlas); } } else { DoImport(atlas); } } GUILayout.EndHorizontal(); GUILayout.Label("Final Atlas"); GUILayout.Label(atlas.atlasTexture); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { if (GUILayout.Button(refreshButtonContent)) { var palette = target as ColorPaletteSO; palette.UpdateDefaults(); } serializedObject.Update(); EditorList.Show(serializedObject.FindProperty("defaults"), false); EditorList.Show(serializedObject.FindProperty("customs"), true); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.PropertyField(m_currencyCount); EditorGUILayout.Space(10); levelLength = m_level.arraySize; EditorList.Show(m_level, m_difficultyBalance); serializedObject.ApplyModifiedProperties(); }
/* * property drawer 和 editor的区别: * 前者操作的是:SerializedProperty。它需要通过函数获取property。 * 后者操作的是:SerializedObject。只要该物体被选中,此editor就会存在,并保留对数据的引用。 使用EditorGUILayout来管理position。 */ public override void OnInspectorGUI() { serializedObject.Update(); //与组件上的值同步 EditorList.Show(serializedObject.FindProperty("integers")); EditorList.Show(serializedObject.FindProperty("vectors")); EditorList.Show(serializedObject.FindProperty("colorPoints"), EditorListOption.All); EditorList.Show(serializedObject.FindProperty("objects")); EditorList.Show(serializedObject.FindProperty("notAList")); serializedObject.ApplyModifiedProperties(); //与组件上的值同步 }
public override void OnInspectorGUI() { serializedObject.Update(); EditorList.Show( serializedObject.FindProperty("ToolTypeDataMaps"), EditorListOption.ButtonsBelow | EditorListOption.ListLabel | EditorListOption.Buttons | EditorListOption.ElementLabels, (element, _) => { int?enumId = element.FindPropertyRelative("ToolType")?.intValue; return(Enum.GetName(typeof(SpiritWorld.Inventories.Items.Tool.Type), enumId)); } ); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); EditorList.Show(ints, EditorListOption.AddRemButtons | EditorListOption.MoveButton); EditorList.Show(vecs, EditorListOption.AddRemButtons); EditorList.Show(parts, EditorListOption.AddRemButtons); EditorList.Show(modules, EditorListOption.ElementLabels | EditorListOption.ListLabel | EditorListOption.AddRemButtons); //EditorGUILayout.PropertyField(ints, true); //EditorGUILayout.PropertyField(vecs, true); //EditorGUILayout.PropertyField(parts, true); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { GUI.enabled = Application.isPlaying; GameEvent e = target as GameEvent; if (GUILayout.Button("Raise")) { e.Raise(); } EditorList.Show(serializedObject.FindProperty("eventListeners"), EditorListOption.ListLabel | EditorListOption.NamedElementLabels | EditorListOption.ElementLabels); }
public override void OnInspectorGUI() { serializedObject.Update(); EditorList.Show( serializedObject.FindProperty("TileFeatureDataMaps"), EditorListOption.ButtonsBelow | EditorListOption.ListLabel | EditorListOption.Buttons | EditorListOption.ElementLabels, (element, _) => { int?featureId = element.FindPropertyRelative("TileFeatureType").FindPropertyRelative("tileFeatureId")?.intValue; return(featureId != 0 && featureId != null ? TileFeature.Types.Get((byte)featureId).Name : "No Feature Set"); } ); serializedObject.ApplyModifiedProperties(); }
//public string listName = string.Empty; //public StringDataValue NameValuePrefab; //public IntDataValue IndexValuePrefab; //public ColumnHeading ColumnHeadingPrefab; //public string UPC_ColumnName = "UPC"; //public string ALU_ColumnName = "Alternate Lookup"; //public ColumnHeading UPC_Column; //public ColumnHeading ALU_Column; //public List<ColumnMap> maps; //public List<ColumnHeading> headings; //public List<InventoryItem> items; public override void OnInspectorGUI() { serializedObject.Update(); ItemList list = (ItemList)target; GetColumnHeadings(list); ExportItems(list); EditorGUILayout.PropertyField(serializedObject.FindProperty("listName"), true); if (list.Headings.Count == 0) { EditorGUILayout.PropertyField(serializedObject.FindProperty("NameValuePrefab"), true); } if (list.Headings.Count == 0) { EditorGUILayout.PropertyField(serializedObject.FindProperty("IndexValuePrefab"), true); } if (list.Headings.Count == 0) { EditorGUILayout.PropertyField(serializedObject.FindProperty("ColumnHeadingPrefab"), true); } if (list.Headings.Count == 0) { EditorGUILayout.PropertyField(serializedObject.FindProperty("InventoryItemPrefab"), true); } if (list.UPC_Column == null) { EditorGUILayout.PropertyField(serializedObject.FindProperty("UPC_ColumnName"), true); } if (list.ALU_Column == null) { EditorGUILayout.PropertyField(serializedObject.FindProperty("ALU_ColumnName"), true); } EditorGUILayout.PropertyField(serializedObject.FindProperty("UPC_Column"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("ALU_Column"), true); //EditorGUILayout.PropertyField(serializedObject.FindProperty("maps"), true); //EditorGUILayout.PropertyField(serializedObject.FindProperty("headings"), true); //EditorGUILayout.PropertyField(serializedObject.FindProperty("items"), true); EditorList.Show(serializedObject.FindProperty("AltVendorMaps"), EditorListOption.ListLabel | EditorListOption.Buttons); EditorList.Show(serializedObject.FindProperty("AltVendorALUColumns"), EditorListOption.ListLabel | EditorListOption.Buttons); EditorMapList.Show(serializedObject.FindProperty("Maps"), EditorMapListOption.ListLabel | EditorMapListOption.Buttons | EditorMapListOption.Import); EditorList.Show(serializedObject.FindProperty("Headings")); ShowItemsList(); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { //base.OnInspectorGUI(); serializedObject.Update(); EditorGUIUtility.labelWidth = 60f; EditorGUILayout.PropertyField(frame, true); EditorGUILayout.PropertyField(mass, true); EditorGUILayout.PropertyField(health, true); EditorGUILayout.PropertyField(damage, true); EditorList.Show(applicators, EditorListOption.ListLabel | EditorListOption.AddRemButtons); EditorGUILayout.PropertyField(spinner, true); if (serializedObject.ApplyModifiedProperties()) { DisplayModel(); } }
public override void OnInspectorGUI() { //DrawDefaultInspector(); //Update our list GetTarget.Update(); EditorGUILayout.HelpBox("UI Layout Drawing", MessageType.None); EditorGUILayout.PropertyField(GetTarget.FindProperty("DrawLayout")); EditorGUILayout.PropertyField(GetTarget.FindProperty("Width")); EditorGUILayout.PropertyField(GetTarget.FindProperty("Height")); EditorGUILayout.PropertyField(GetTarget.FindProperty("Depth")); EditorGUILayout.PropertyField(GetTarget.FindProperty("LinesColor")); EditorGUILayout.HelpBox("Atom Rules", MessageType.None); EditorList.Show(GetTarget.FindProperty("RuleSet")); //Apply the changes to our list GetTarget.ApplyModifiedProperties(); }