public override void OnInspectorGUI() { var data = target as UtilityCurves; // AI states dictionary SDictionaryGUI.AddGUI addGUI = () => { data.aiStates.EnumAddGUI(); }; SDictionaryGUI.ValueGUI <UtilityCurves.CurveDict> valueGUI = (dict) => { SDictionaryGUI.AddGUI innerAddGUI = () => { dict.StringAddGUI(ref innerAddStr); }; SDictionaryGUI.ValueGUI <AnimationCurve> innerValueGUI = (curve) => { curve = EditorGUILayout.CurveField(curve); return(curve); }; dict.DoGUILayout(innerValueGUI, innerAddGUI, "Values", true); return(dict); }; data.aiStates.DoGUILayout(valueGUI, addGUI, "AI States"); // Macro values dictionary SDictionaryGUI.AddGUI macroAddGUI = () => { data.macroValues.StringAddGUI(ref macroAddStr); }; SDictionaryGUI.ValueGUI <UtilityCurves.CurveDict> macroValueGUI = (dict) => { SDictionaryGUI.AddGUI innerAddGUI = () => { dict.StringAddGUI(ref macroInnerAddStr); }; SDictionaryGUI.ValueGUI <AnimationCurve> innerValueGUI = (curve) => { curve = EditorGUILayout.CurveField(curve); return(curve); }; dict.DoGUILayout(innerValueGUI, innerAddGUI, "Sub Values", true); return(dict); }; data.macroValues.DoGUILayout(macroValueGUI, macroAddGUI, "Macro Values"); EditorUtils.SetSceneDirtyIfGUIChanged(target); }
public override void OnInspectorGUI() { var i = target as InputManager; i.keyboardControls = EditorGUILayout.ObjectField(new GUIContent("Keyboard Control Profile"), i.keyboardControls, typeof(ControlProfile), false) as ControlProfile; i.gamepadControls = EditorGUILayout.ObjectField(new GUIContent("GamePad Control Profile"), i.gamepadControls, typeof(ControlProfile), false) as ControlProfile; SDictionaryGUI.ValueGUI <ControlProfile> valGUI = (c) => { return(EditorGUILayout.ObjectField(c, typeof(ControlProfile), false) as ControlProfile); }; i.controlProfiles.DoGUILayout(valGUI, () => i.controlProfiles.StringAddGUI(ref addStr), "Profiles", true); EditorUtils.SetSceneDirtyIfGUIChanged(target); }
public override void OnInspectorGUI() { DialogData dialogData = target as DialogData; dialogData.displayName = EditorGUILayout.TextField(new GUIContent("Display name"), dialogData.displayName); dialogData.textBlipSound = EditorGUILayout.ObjectField(new GUIContent("Text scroll sound"), dialogData.textBlipSound, typeof(AudioClip), false) as AudioClip; SDictionaryGUI.ValueGUI <Sprite> valGUI = (spr) => { return(EditorGUILayout.ObjectField(spr, typeof(Sprite), false) as Sprite); }; dialogData.portraitDictionary.DoGUILayout(valGUI, dialogData.portraitDictionary.EnumAddGUIVal, "Portraits", true); EditorUtils.SetSceneDirtyIfGUIChanged(target); }
public override void OnInspectorGUI() { var data = target as WeatherData; // Display data data.displayName = EditorGUILayout.TextField(new GUIContent("Display Name", displayNameTooltip), data.displayName); EditorUtils.Separator(); data.effectCreator = EditorGUILayout.ObjectField(new GUIContent("Effect Creator"), data.effectCreator, typeof(GameObject), false) as GameObject; data.ambientSound = EditorGUILayout.ObjectField(new GUIContent("Ambient Sound"), data.ambientSound, typeof(AudioClip), false) as AudioClip; SDictionaryGUI.ValueGUI <TimeOfDayData> valGUI = (tod) => { tod.lightColor = EditorGUILayout.ColorField(tod.lightColor); return(tod); }; data.lightingOverrides.DoGUILayout(valGUI, data.lightingOverrides.EnumAddGUI, "Lighting Overrides", true); if (GUI.changed) { EditorUtility.SetDirty(data); } }
public override void OnInspectorGUI() { var w = target as WeatherController; if (EditorApplication.isPlaying) { EditorGUILayout.LabelField(new GUIContent("Weather: " + w.Weather.ToString())); EditorGUILayout.LabelField(new GUIContent("Buffer: " + w.Buffer.ToString())); setTo = (WeatherType)EditorGUILayout.EnumPopup(new GUIContent("Set to"), setTo); if (GUILayout.Button("Set Weather")) { w.Weather = setTo; } } SDictionaryGUI.ValueGUI <WeatherData> valGUI = (data) => { return(EditorGUILayout.ObjectField(data, typeof(WeatherData), false) as WeatherData); }; w.weatherData.DoGUILayout(valGUI, w.weatherData.EnumAddGUI, "Weather Data", true); EditorUtils.SetSceneDirtyIfGUIChanged(target); }
public override void OnInspectorGUI() { var c = target as ControlProfile; c.displayName = EditorGUILayout.TextField(new GUIContent("Display Name"), c.displayName); c.inputSource = (ControlProfile.InputSource)EditorGUILayout.EnumPopup(new GUIContent("Input Source"), c.inputSource); SDictionaryGUI.ValueGUI <AxisName> valGUIAxis = (a) => (AxisName)EditorGUILayout.EnumPopup(a); c.axes.DoGUILayout(valGUIAxis, () => c.axes.EnumAddGUIVal(), "Axis Names", true); SDictionaryGUI.ValueGUI <KeyCode> valGUIKeyBind = (key) => (KeyCode)EditorGUILayout.EnumPopup(key); c.keyBinds.DoGUILayout(valGUIKeyBind, () => c.keyBinds.EnumAddGUI(), "Bindings", true); SDictionaryGUI.ValueGUI <Sprite> valGUISprite = (key) => EditorGUILayout.ObjectField(key, typeof(Sprite), false) as Sprite; c.sprites.DoGUILayout(valGUISprite, () => c.sprites.EnumAddGUIVal(), "Sprites", true); showSecondaries = EditorGUILayout.ToggleLeft(new GUIContent("Show Secondaries"), showSecondaries); if (showSecondaries) { c.secondaryAxes.DoGUILayout(valGUIAxis, () => c.secondaryAxes.EnumAddGUIVal(), "Axis Names 2", true); c.secondaryKeyBinds.DoGUILayout(valGUIKeyBind, () => c.secondaryKeyBinds.EnumAddGUI(), "Bindings 2", true); } if (GUI.changed) { EditorUtility.SetDirty(c); } }