From 42b7d724be43541eeab31d5f804a17ece7ffdf60 Mon Sep 17 00:00:00 2001 From: Carson Kompon Date: Tue, 1 Mar 2022 03:17:06 -0500 Subject: [PATCH 1/3] Started work on merging the karate man events This breaks enum dropdowns but I'll fix that tomorrow --- Assets/Scripts/Games/KarateMan/KarateMan.cs | 9 +++++++ .../EventSelector/EventPropertyPrefab.cs | 4 ++-- .../EventSelector/GridGameSelector.cs | 2 +- Assets/Scripts/Minigames.cs | 24 +++++++++++++++---- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/Assets/Scripts/Games/KarateMan/KarateMan.cs b/Assets/Scripts/Games/KarateMan/KarateMan.cs index 31891d6ce..cf94d1d9e 100644 --- a/Assets/Scripts/Games/KarateMan/KarateMan.cs +++ b/Assets/Scripts/Games/KarateMan/KarateMan.cs @@ -8,6 +8,15 @@ namespace RhythmHeavenMania.Games.KarateMan { public class KarateMan : Minigame { + + public enum HitType + { + Pot = 0, + Rock = 2, + Ball = 3, + TacoBell = 6 + } + public enum LightBulbType { Normal, diff --git a/Assets/Scripts/LevelEditor/EventSelector/EventPropertyPrefab.cs b/Assets/Scripts/LevelEditor/EventSelector/EventPropertyPrefab.cs index ce4fc5ff1..3f3c31a79 100644 --- a/Assets/Scripts/LevelEditor/EventSelector/EventPropertyPrefab.cs +++ b/Assets/Scripts/LevelEditor/EventSelector/EventPropertyPrefab.cs @@ -99,11 +99,11 @@ namespace RhythmHeavenMania.Editor dropDownData.Add(optionData); } dropdown.AddOptions(dropDownData); - dropdown.value = ((int)Enum.Parse(objType, parameterManager.entity[propertyName].ToString())); + dropdown.value = Array.IndexOf(Enum.GetValues(objType), Enum.GetValues(objType).GetValue((int)parameterManager.entity[propertyName])); dropdown.onValueChanged.AddListener(delegate { - parameterManager.entity[propertyName] = Enum.ToObject(objType, dropdown.value); + parameterManager.entity[propertyName] = (int)Enum.GetValues(objType).GetValue(dropdown.value); }); } else if (objType == typeof(Color)) diff --git a/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs b/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs index 7f57ac612..0138c5157 100644 --- a/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs +++ b/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs @@ -120,7 +120,7 @@ namespace RhythmHeavenMania.Editor for (int i = 0; i < mg.actions.Count; i++) { - if (mg.actions[i].actionName == "switchGame") continue; + if (mg.actions[i].actionName == "switchGame" || mg.actions[i].hidden) continue; GameObject g = Instantiate(EventRef, eventsParent); g.GetComponent().text = mg.actions[i].actionName; g.SetActive(true); diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs index 72e0798aa..c50dbef01 100644 --- a/Assets/Scripts/Minigames.cs +++ b/Assets/Scripts/Minigames.cs @@ -49,14 +49,20 @@ namespace RhythmHeavenMania public float defaultLength; public bool resizable; public List parameters; + public bool hidden; - public GameAction(string actionName, EventCallback function, float defaultLength = 1, bool resizable = false, List parameters = null) + /* If you want to add additional arguments to GameAction, leave `bool hidden = false` as the last parameter + * You can specify an action as hidden by adding `hidden: value` as the final parameter in your call + * (Even if you haven't used all prior arguments) + */ + public GameAction(string actionName, EventCallback function, float defaultLength = 1, bool resizable = false, List parameters = null, bool hidden = false) { this.actionName = actionName; this.function = function; this.defaultLength = defaultLength; this.resizable = resizable; this.parameters = parameters; + this.hidden = hidden; } } @@ -235,7 +241,13 @@ namespace RhythmHeavenMania new Minigame("karateman", "Karate Man", "70A8D8", false, false, new List() { new GameAction("bop", delegate { KarateMan.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 0.5f, true), - new GameAction("pot", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 0); }, 2), + new GameAction("hit", delegate + { + KarateMan.instance.Shoot(eventCaller.currentEntity.beat, eventCaller.currentEntity.type); + }, 2, false, new List() + { + new Param("type", KarateMan.HitType.Pot, "Object") + }), new GameAction("bulb", delegate { var e = eventCaller.currentEntity; var c = KarateMan.instance.LightBulbColors[e.type]; @@ -246,8 +258,6 @@ namespace RhythmHeavenMania new Param("type", KarateMan.LightBulbType.Normal, "Type"), new Param("colorA", new Color(), "Custom Color") }), - new GameAction("rock", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 2); }, 2), - new GameAction("ball", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 3); }, 2), new GameAction("kick", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 4); }, 4.5f), new GameAction("combo", delegate { KarateMan.instance.Combo(eventCaller.currentEntity.beat); }, 4f), new GameAction("hit3", delegate { KarateMan.instance.Hit3(eventCaller.currentEntity.beat); }), @@ -267,7 +277,11 @@ namespace RhythmHeavenMania new Param("colorA", new Color(), "Custom Background Color"), new Param("colorB", new Color(), "Custom Shadow Color") }), - new GameAction("tacobell", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 6); }, 2), + // These are still here for backwards-compatibility but are hidden in the editor + new GameAction("pot", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 0); }, 2, hidden: true), + new GameAction("rock", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 2); }, 2, hidden: true), + new GameAction("ball", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 3); }, 2, hidden: true), + new GameAction("tacobell", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 6); }, 2, hidden: true), }), new Minigame("spaceSoccer", "Space Soccer", "B888F8", false, false, new List() { From 4142c09a4c8a11443dbfcb7614353a1cb0f7aa0f Mon Sep 17 00:00:00 2001 From: Carson Kompon Date: Tue, 1 Mar 2022 12:40:59 -0500 Subject: [PATCH 2/3] Karate Man Events have been merged also I forgot the toggle in the last update lol --- Assets/Scenes/Editor.unity | 442 +++++++++++++++++- Assets/Scripts/Games/KarateMan/KarateMan.cs | 25 +- .../EventSelector/EventPropertyPrefab.cs | 13 +- Assets/Scripts/Minigames.cs | 29 +- 4 files changed, 491 insertions(+), 18 deletions(-) diff --git a/Assets/Scenes/Editor.unity b/Assets/Scenes/Editor.unity index 89a67a1ac..3c5202e79 100644 --- a/Assets/Scenes/Editor.unity +++ b/Assets/Scenes/Editor.unity @@ -2324,7 +2324,7 @@ RectTransform: - {fileID: 44496735} - {fileID: 9172948791891367921} m_Father: {fileID: 830452352} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} @@ -2347,6 +2347,7 @@ MonoBehaviour: parameterManager: {fileID: 830452354} slider: {fileID: 0} inputField: {fileID: 0} + toggle: {fileID: 0} dropdown: {fileID: 9172948791891367920} ColorBTN: {fileID: 0} ColorTable: {fileID: 0} @@ -3314,6 +3315,91 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 270008764} m_CullTransparentMesh: 1 +--- !u!1 &279538357 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 279538358} + - component: {fileID: 279538359} + m_Layer: 5 + m_Name: Toggle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &279538358 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 279538357} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 573383257} + m_Father: {fileID: 755586978} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -114.75, y: 0} + m_SizeDelta: {x: 160, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &279538359 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 279538357} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 573383258} + toggleTransition: 1 + graphic: {fileID: 690238907} + m_Group: {fileID: 0} + onValueChanged: + m_PersistentCalls: + m_Calls: [] + m_IsOn: 1 --- !u!1 &285804966 GameObject: m_ObjectHideFlags: 0 @@ -3882,6 +3968,7 @@ MonoBehaviour: parameterManager: {fileID: 830452354} slider: {fileID: 749529046} inputField: {fileID: 735918245} + toggle: {fileID: 0} dropdown: {fileID: 0} ColorBTN: {fileID: 0} ColorTable: {fileID: 0} @@ -4264,6 +4351,7 @@ MonoBehaviour: parameterManager: {fileID: 830452354} slider: {fileID: 2067224779} inputField: {fileID: 1182082595} + toggle: {fileID: 0} dropdown: {fileID: 0} ColorBTN: {fileID: 0} ColorTable: {fileID: 0} @@ -6390,6 +6478,82 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 566999362} m_CullTransparentMesh: 1 +--- !u!1 &573383256 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 573383257} + - component: {fileID: 573383259} + - component: {fileID: 573383258} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &573383257 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 573383256} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 690238906} + m_Father: {fileID: 279538358} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 10, y: -10} + m_SizeDelta: {x: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &573383258 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 573383256} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &573383259 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 573383256} + m_CullTransparentMesh: 1 --- !u!1 &575663592 GameObject: m_ObjectHideFlags: 0 @@ -7805,6 +7969,81 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 689781276} m_CullTransparentMesh: 1 +--- !u!1 &690238905 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 690238906} + - component: {fileID: 690238908} + - component: {fileID: 690238907} + m_Layer: 5 + m_Name: Checkmark + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &690238906 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 690238905} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 573383257} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &690238907 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 690238905} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10901, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &690238908 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 690238905} + m_CullTransparentMesh: 1 --- !u!1 &703340358 GameObject: m_ObjectHideFlags: 0 @@ -8467,6 +8706,66 @@ RectTransform: m_AnchoredPosition: {x: 61.96001, y: 0.0000097752} m_SizeDelta: {x: -123.92, y: 30} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &755586977 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 755586978} + - component: {fileID: 755586979} + m_Layer: 5 + m_Name: Boolean + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &755586978 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 755586977} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 774969485} + - {fileID: 279538358} + m_Father: {fileID: 830452352} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 537.35, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &755586979 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 755586977} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3b7c76a246115c1459c963e93f7db056, type: 3} + m_Name: + m_EditorClassIdentifier: + caption: {fileID: 774969486} + parameterManager: {fileID: 830452354} + slider: {fileID: 0} + inputField: {fileID: 0} + toggle: {fileID: 279538359} + dropdown: {fileID: 0} + ColorBTN: {fileID: 0} + ColorTable: {fileID: 0} + colorTableActive: 0 + colorPreview: {fileID: 0} --- !u!1 &767779042 GameObject: m_ObjectHideFlags: 0 @@ -8590,6 +8889,140 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 770589359} m_CullTransparentMesh: 1 +--- !u!1 &774969484 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 774969485} + - component: {fileID: 774969487} + - component: {fileID: 774969486} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &774969485 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 774969484} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 755586978} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 63.92, y: 0} + m_Pivot: {x: 0, y: 0.5} +--- !u!114 &774969486 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 774969484} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: Boolean + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 78e7291cdeccdfc4fa61249845605144, type: 2} + m_sharedMaterial: {fileID: 5250768452915780979, guid: 78e7291cdeccdfc4fa61249845605144, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 17.45 + m_fontSizeBase: 20 + m_fontWeight: 400 + m_enableAutoSizing: 1 + m_fontSizeMin: 3 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &774969487 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 774969484} + m_CullTransparentMesh: 1 --- !u!1 &781200685 GameObject: m_ObjectHideFlags: 0 @@ -8861,6 +9294,7 @@ MonoBehaviour: valA: 0 valB: 0 valC: 0 + toggle: 0 type: 0 type2: 0 ease: 0 @@ -9076,6 +9510,7 @@ RectTransform: m_Children: - {fileID: 396879233} - {fileID: 345301791} + - {fileID: 755586978} - {fileID: 184838088} - {fileID: 1443721747} m_Father: {fileID: 1050802356} @@ -9128,6 +9563,7 @@ MonoBehaviour: gridGameSelector: {fileID: 1154875947} IntegerP: {fileID: 396879232} FloatP: {fileID: 345301789} + BooleanP: {fileID: 0} DropdownP: {fileID: 184838087} ColorP: {fileID: 1443721746} entity: @@ -9137,6 +9573,7 @@ MonoBehaviour: valA: 0 valB: 0 valC: 0 + toggle: 0 type: 0 type2: 0 ease: 0 @@ -14262,7 +14699,7 @@ RectTransform: - {fileID: 1535224917} - {fileID: 723094753} m_Father: {fileID: 830452352} - m_RootOrder: 3 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} @@ -14285,6 +14722,7 @@ MonoBehaviour: parameterManager: {fileID: 830452354} slider: {fileID: 0} inputField: {fileID: 0} + toggle: {fileID: 0} dropdown: {fileID: 0} ColorBTN: {fileID: 1535224918} ColorTable: {fileID: 723094753} diff --git a/Assets/Scripts/Games/KarateMan/KarateMan.cs b/Assets/Scripts/Games/KarateMan/KarateMan.cs index cf94d1d9e..b99edfe00 100644 --- a/Assets/Scripts/Games/KarateMan/KarateMan.cs +++ b/Assets/Scripts/Games/KarateMan/KarateMan.cs @@ -36,6 +36,12 @@ namespace RhythmHeavenMania.Games.KarateMan Custom } + public enum BackgroundFXType + { + None, + Sunburst + } + public enum ShadowType { Tinted, @@ -64,6 +70,7 @@ namespace RhythmHeavenMania.Games.KarateMan public SpriteRenderer BGFXSprite; public BackgroundType BGType = BackgroundType.Yellow; + public BackgroundFXType BGFXType = BackgroundFXType.None; public Color BGColor; public ShadowType Shadow = ShadowType.Tinted; @@ -269,14 +276,18 @@ namespace RhythmHeavenMania.Games.KarateMan } } - public void BGFXOn() + public void SetBackgroundFX(BackgroundFXType type) { - BGFXSprite.enabled = true; - } - - public void BGFXOff() - { - BGFXSprite.enabled = false; + BGFXType = type; + + if(BGFXType == BackgroundFXType.None) + { + BGFXSprite.enabled = false; + } + else + { + BGFXSprite.enabled = true; + } } public void SetBackgroundColor(int type, int shadowType, Color backgroundColor, Color shadowColor) diff --git a/Assets/Scripts/LevelEditor/EventSelector/EventPropertyPrefab.cs b/Assets/Scripts/LevelEditor/EventSelector/EventPropertyPrefab.cs index deee15db4..215e52fcc 100644 --- a/Assets/Scripts/LevelEditor/EventSelector/EventPropertyPrefab.cs +++ b/Assets/Scripts/LevelEditor/EventSelector/EventPropertyPrefab.cs @@ -102,18 +102,23 @@ namespace RhythmHeavenMania.Editor else if (objType.IsEnum) { List dropDownData = new List(); - for (int i = 0; i < System.Enum.GetValues(objType).Length; i++) + var vals = Enum.GetValues(objType); + var selected = 0; + for (int i = 0; i < vals.Length; i++) { - string name = System.Enum.GetNames(objType)[i]; + string name = Enum.GetNames(objType)[i]; TMP_Dropdown.OptionData optionData = new TMP_Dropdown.OptionData(); optionData.text = name; dropDownData.Add(optionData); + + if ((int)vals.GetValue(i) == (int)parameterManager.entity[propertyName]) + selected = i; } dropdown.AddOptions(dropDownData); - dropdown.value = Array.IndexOf(Enum.GetValues(objType), Enum.GetValues(objType).GetValue((int)parameterManager.entity[propertyName])); - + dropdown.value = selected; + dropdown.onValueChanged.AddListener(delegate { parameterManager.entity[propertyName] = (int)Enum.GetValues(objType).GetValue(dropdown.value); diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs index 20ea0eb02..32779c301 100644 --- a/Assets/Scripts/Minigames.cs +++ b/Assets/Scripts/Minigames.cs @@ -267,11 +267,18 @@ namespace RhythmHeavenMania }), new GameAction("kick", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 4); }, 4.5f), new GameAction("combo", delegate { KarateMan.instance.Combo(eventCaller.currentEntity.beat); }, 4f), - new GameAction("hit3", delegate { KarateMan.instance.Hit3(eventCaller.currentEntity.beat); }), - new GameAction("hit4", delegate { KarateMan.instance.Hit4(eventCaller.currentEntity.beat); }), + new GameAction("hit3", delegate + { + var e = eventCaller.currentEntity; + if(e.toggle) + KarateMan.instance.Hit4(e.beat); + else + KarateMan.instance.Hit3(e.beat); + }, 1f, false, new List() + { + new Param("toggle", false, "Hit 4") + }), new GameAction("prepare", delegate { KarateMan.instance.Prepare(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 1f, true), - new GameAction("bgfxon", delegate { KarateMan.instance.BGFXOn(); } ), - new GameAction("bgfxoff", delegate { KarateMan.instance.BGFXOff(); }), new GameAction("set background color", delegate { var e = eventCaller.currentEntity; var c = KarateMan.instance.BackgroundColors[e.type]; @@ -282,13 +289,25 @@ namespace RhythmHeavenMania new Param("type", KarateMan.BackgroundType.Yellow, "Background Type"), new Param("type2", KarateMan.ShadowType.Tinted, "Shadow Type"), new Param("colorA", new Color(), "Custom Background Color"), - new Param("colorB", new Color(), "Custom Shadow Color") + new Param("colorB", new Color(), "Custom Shadow Color"), + + }), + new GameAction("set background fx", delegate { + KarateMan.instance.SetBackgroundFX((KarateMan.BackgroundFXType)eventCaller.currentEntity.type); + }, 0.5f, false, new List() + { + new Param("type", KarateMan.BackgroundFXType.None, "FX Type") + }), // These are still here for backwards-compatibility but are hidden in the editor new GameAction("pot", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 0); }, 2, hidden: true), new GameAction("rock", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 2); }, 2, hidden: true), new GameAction("ball", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 3); }, 2, hidden: true), new GameAction("tacobell", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 6); }, 2, hidden: true), + new GameAction("hit4", delegate { KarateMan.instance.Hit4(eventCaller.currentEntity.beat); }, hidden: true), + new GameAction("bgfxon", delegate { KarateMan.instance.SetBackgroundFX(KarateMan.BackgroundFXType.Sunburst); }, hidden: true), + new GameAction("bgfxoff", delegate { KarateMan.instance.SetBackgroundFX(KarateMan.BackgroundFXType.None); }, hidden: true), + }), new Minigame("spaceSoccer", "Space Soccer", "B888F8", false, false, new List() { From 734a4713bbd640e1206b4696370c2b1f8906550a Mon Sep 17 00:00:00 2001 From: Carson Kompon Date: Tue, 1 Mar 2022 12:52:47 -0500 Subject: [PATCH 3/3] im sorry im dumb i fixed it for real idk why unity wasnt saving these changes --- Assets/Scenes/Editor.unity | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/Scenes/Editor.unity b/Assets/Scenes/Editor.unity index 3c5202e79..792e1bbe9 100644 --- a/Assets/Scenes/Editor.unity +++ b/Assets/Scenes/Editor.unity @@ -8722,7 +8722,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &755586978 RectTransform: m_ObjectHideFlags: 0 @@ -8739,9 +8739,9 @@ RectTransform: m_Father: {fileID: 830452352} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 288.675, y: -25} m_SizeDelta: {x: 537.35, y: 30} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &755586979