From 441331ec878789912aa0ec8c693e3be801b086e5 Mon Sep 17 00:00:00 2001 From: Epicgamer2469 Date: Thu, 21 Mar 2024 18:57:14 -0500 Subject: [PATCH] Add previewing note when slider handle is clicked --- .../Editor/EventProperties/Note.prefab | 46 +++++++++++- .../Sfx/games/builtToScaleDS/PianoPreview.ogg | Bin 10258 -> 10108 bytes .../Scripts/Games/LaunchParty/LaunchParty.cs | 66 +++++++++--------- .../PropertyPrefabs/NotePropertyPrefab.cs | 21 +++--- Assets/Scripts/UI/LeftClickEvent.cs | 18 +++++ Assets/Scripts/UI/LeftClickEvent.cs.meta | 11 +++ Assets/Scripts/Util/Sound.cs | 12 ++-- 7 files changed, 125 insertions(+), 49 deletions(-) create mode 100644 Assets/Scripts/UI/LeftClickEvent.cs create mode 100644 Assets/Scripts/UI/LeftClickEvent.cs.meta diff --git a/Assets/Resources/Prefabs/Editor/EventProperties/Note.prefab b/Assets/Resources/Prefabs/Editor/EventProperties/Note.prefab index c6799f8a1..f7bbb2a5e 100644 --- a/Assets/Resources/Prefabs/Editor/EventProperties/Note.prefab +++ b/Assets/Resources/Prefabs/Editor/EventProperties/Note.prefab @@ -545,6 +545,7 @@ GameObject: - component: {fileID: 6158244586092265563} - component: {fileID: 6158244586092265565} - component: {fileID: 6158244586092265564} + - component: {fileID: 4416041990617176705} m_Layer: 5 m_Name: Handle m_TagString: Untagged @@ -610,6 +611,33 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!114 &4416041990617176705 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6158244586092265562} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e365c37b20b7e15458fab7eef4b17449, type: 3} + m_Name: + m_EditorClassIdentifier: + OnLeftClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 5889849442551835445} + m_TargetAssemblyTypeName: NotePropertyPrefab, Assembly-CSharp + m_MethodName: OnSelectSliderHandle + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!1 &6158244586323976421 GameObject: m_ObjectHideFlags: 0 @@ -1047,6 +1075,7 @@ GameObject: - component: {fileID: 6158244586633658522} - component: {fileID: 6158244586633658523} - component: {fileID: 6158244586633658524} + - component: {fileID: 1757629852665466133} m_Layer: 5 m_Name: Slider m_TagString: Untagged @@ -1146,7 +1175,7 @@ MonoBehaviour: action: m_PersistentCalls: m_Calls: - - m_Target: {fileID: 0} + - m_Target: {fileID: 5889849442551835445} m_TargetAssemblyTypeName: HeavenStudio.Editor.NumberPropertyPrefab, Assembly-CSharp m_MethodName: ResetValue m_Mode: 1 @@ -1160,3 +1189,18 @@ MonoBehaviour: m_CallState: 2 _masterTrans: {fileID: 0} _dropDown: {fileID: 8384641343036272350, guid: 56a45ac5cd0da2a4ab398d1a63e18d9f, type: 3} +--- !u!114 &1757629852665466133 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6158244586633658521} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e365c37b20b7e15458fab7eef4b17449, type: 3} + m_Name: + m_EditorClassIdentifier: + OnLeftClick: + m_PersistentCalls: + m_Calls: [] diff --git a/Assets/Resources/Sfx/games/builtToScaleDS/PianoPreview.ogg b/Assets/Resources/Sfx/games/builtToScaleDS/PianoPreview.ogg index 7f84f6208792fcdd1e72b66c3bffe388c0d9924b..6448d4d5ad14420e6d90b4e6afcebbcdaeef0656 100644 GIT binary patch delta 4278 zcmXY#c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kJ{GtUS&yMzaDz{YA%0kPq!Kcl2z2?_m1rjkE>%_t%@UPp3{7E>Uo4wq zGdYU(^4Gs0-@pCO=HJrl$0zchh5q_|U+#1E!eBpVIM=lOT}u%`db54T zv^s6HH~a6(u0WMtI9Um=uA^t>#|4->v9syu16~?YWunr^&%a9HPm-@N6*AC!94!?` z4(g%d#1UsK@*o!ogd<_w@`&qY7UFpY6}=a!KLN2#P$t_lQ6$l8?#ahu3kI_) zV!#~z@hk>Fap}JCRB!KdYHPdb!=+cpGpKmZTxsGi+AfbHH>$pjiochVm3 z0?=G3@~^)moMdo&)I<~AR1W`r3yR(cNXXIzSYrhOV0e9l!&SjMRgnnjhmkcmaisky zYN-g)wS@~bnqeYyKB)9Rc<*7IPd2BhCR zooF)1E7Jze28j2{DV7|1XdK9j5rj+jS8$!4B>}Tii0*>QYX{_f;^d(nK=m$Kb~f($ z>_zal7!43lDbTnt65W>Krj5lTeQwwzI;M&mg9UgZQav1?JcH9Ig&w>Z1V-8%fG-Y#SHx%#{&O!uz5pFGK!>jI}Z5fOB9>b zJ}1gMf3ys6d1?N9A^4-^nILPN^tt*%J4LbYnU7uaI-EotLK?&l3krU%$1Uv;L^}kdL1Yfh zwP*(n8ontT4qgSXz7|8T_JWQjJt08K|26q7HNVN$CuOk4W~}y>dP%ogcAcqYh3hk? zF@MM1>LHKiruZ=tAG*+#452men+si`q#m4fv}(v-_jOyQd-_LvLV1II*x#5cO4d7f z?n@HZ8`iE-)^*iBE4?fqssyjO?7xkSEi8xYbe?}EQcYdS*~r}B91MQ4^(1$IU+93x a$jrQBulBsXgUIT<<2=b~9qvtV1OEZq`G7?L diff --git a/Assets/Scripts/Games/LaunchParty/LaunchParty.cs b/Assets/Scripts/Games/LaunchParty/LaunchParty.cs index 6c31947a4..23c51b48a 100644 --- a/Assets/Scripts/Games/LaunchParty/LaunchParty.cs +++ b/Assets/Scripts/Games/LaunchParty/LaunchParty.cs @@ -20,10 +20,10 @@ namespace HeavenStudio.Games.Loaders parameters = new List() { new Param("offset", new EntityTypes.Float(-1, 2, -1), "Spawn Offset", "Set when the rocket should rise up."), - new Param("note1", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 2, 1,4, "launchParty/rocket_note"), "1st Note", "Set the number of semitones up or down this note should be pitched."), - new Param("note2", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 4, 1,4, "launchParty/rocket_note"), "2nd Note", "Set the number of semitones up or down this note should be pitched."), - new Param("note3", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 5, 1,4, "launchParty/rocket_note"), "3rd Note", "Set the number of semitones up or down this note should be pitched."), - new Param("note4", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 7, 1,4, "launchParty/rocket_note"), "4th Note", "Set the number of semitones up or down this note should be pitched.") + new Param("note1", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 2, 0,4, "launchParty/rocket_note"), "1st Note", "Set the number of semitones up or down this note should be pitched."), + new Param("note2", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 4, 0,4, "launchParty/rocket_note"), "2nd Note", "Set the number of semitones up or down this note should be pitched."), + new Param("note3", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 5, 0,4, "launchParty/rocket_note"), "3rd Note", "Set the number of semitones up or down this note should be pitched."), + new Param("note4", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 7, 0,4, "launchParty/rocket_note"), "4th Note", "Set the number of semitones up or down this note should be pitched.") } }, new GameAction("partyCracker", "Party-Popper") @@ -33,12 +33,12 @@ namespace HeavenStudio.Games.Loaders parameters = new List() { new Param("offset", new EntityTypes.Float(-1, 1, -1), "Spawn Offset", "Set when the rocket should rise up."), - new Param("note1", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 4, 1, 4, "launchParty/popper_note"), "1st Note", "Set the number of semitones up or down this note should be pitched."), - new Param("note2", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 5, 1, 4, "launchParty/popper_note"), "2nd Note", "Set the number of semitones up or down this note should be pitched."), - new Param("note3", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 7, 1, 4, "launchParty/popper_note"), "3rd Note", "Set the number of semitones up or down this note should be pitched."), - new Param("note4", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 9, 1, 4, "launchParty/popper_note"), "4th Note", "Set the number of semitones up or down this note should be pitched."), - new Param("note5", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 11, 1, 4, "launchParty/popper_note"), "5th Note", "Set the number of semitones up or down this note should be pitched."), - new Param("note6", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 12, 1, 4, "launchParty/popper_note"), "6th Note", "Set the number of semitones up or down this note should be pitched.") + new Param("note1", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 4, 0, 4, "launchParty/popper_note"), "1st Note", "Set the number of semitones up or down this note should be pitched."), + new Param("note2", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 5, 0, 4, "launchParty/popper_note"), "2nd Note", "Set the number of semitones up or down this note should be pitched."), + new Param("note3", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 7, 0, 4, "launchParty/popper_note"), "3rd Note", "Set the number of semitones up or down this note should be pitched."), + new Param("note4", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 9, 0, 4, "launchParty/popper_note"), "4th Note", "Set the number of semitones up or down this note should be pitched."), + new Param("note5", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 11, 0, 4, "launchParty/popper_note"), "5th Note", "Set the number of semitones up or down this note should be pitched."), + new Param("note6", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 12, 0, 4, "launchParty/popper_note"), "6th Note", "Set the number of semitones up or down this note should be pitched.") } }, new GameAction("bell", "Bell") @@ -50,14 +50,14 @@ namespace HeavenStudio.Games.Loaders { new Param("offset", new EntityTypes.Float(-1, 1, -1), "Spawn Offset", "Set when the rocket should rise up."), new Param("note1", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 0, 4, "launchParty/bell_note"), "1st Note", "Set the number of semitones up or down this note should be pitched."), - new Param("note2", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 2, 1, 4, "launchParty/bell_short"), "2nd Note", "Set the number of semitones up or down this note should be pitched."), - new Param("note3", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 4, 1, 4, "launchParty/bell_short"), "3rd Note", "Set the number of semitones up or down this note should be pitched."), - new Param("note4", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 5, 1, 4, "launchParty/bell_short"), "4th Note", "Set the number of semitones up or down this note should be pitched."), - new Param("note5", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 7, 1, 4, "launchParty/bell_short"), "5th Note", "Set the number of semitones up or down this note should be pitched."), - new Param("note6", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 9, 1, 4, "launchParty/bell_short"), "6th Note", "Set the number of semitones up or down this note should be pitched."), - new Param("note7", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 11, 1, 4, "launchParty/bell_short"), "7th Note", "Set the number of semitones up or down this note should be pitched."), - new Param("note8", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 12, 1, 4, "launchParty/bell_short"), "8th Note", "Set the number of semitones up or down this note should be pitched."), - new Param("note9", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 1, 4, "launchParty/bell_blast"), "9th Note (Launch)", "Set the number of semitones up or down this note should be pitched."), + new Param("note2", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 2, 0, 4, "launchParty/bell_short"), "2nd Note", "Set the number of semitones up or down this note should be pitched."), + new Param("note3", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 4, 0, 4, "launchParty/bell_short"), "3rd Note", "Set the number of semitones up or down this note should be pitched."), + new Param("note4", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 5, 0, 4, "launchParty/bell_short"), "4th Note", "Set the number of semitones up or down this note should be pitched."), + new Param("note5", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 7, 0, 4, "launchParty/bell_short"), "5th Note", "Set the number of semitones up or down this note should be pitched."), + new Param("note6", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 9, 0, 4, "launchParty/bell_short"), "6th Note", "Set the number of semitones up or down this note should be pitched."), + new Param("note7", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 11, 0, 4, "launchParty/bell_short"), "7th Note", "Set the number of semitones up or down this note should be pitched."), + new Param("note8", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 12, 0, 4, "launchParty/bell_short"), "8th Note", "Set the number of semitones up or down this note should be pitched."), + new Param("note9", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 0, 4, "launchParty/bell_blast"), "9th Note (Launch)", "Set the number of semitones up or down this note should be pitched."), } }, new GameAction("bowlingPin", "Bowling Pin") @@ -68,21 +68,21 @@ namespace HeavenStudio.Games.Loaders parameters = new List() { new Param("offset", new EntityTypes.Float(-1, 1, -1), "Spawn Offset", "Set when the rocket should rise up."), - new Param("note1", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 5, 1, 4, "launchParty/pin"), "1st Note", "Set the number of semitones up or down this note should be pitched."), - new Param("note2", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, -1, 1, 4, "launchParty/flute"), "2nd Note (Flute)", "Set the number of semitones up or down this note should be pitched."), - new Param("note3", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 1, 4, "launchParty/flute"), "3rd Note (Flute)", "Set the number of semitones up or down this note should be pitched."), - new Param("note4", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, -1, 1, 4, "launchParty/flute"), "4th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), - new Param("note5", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 1, 4, "launchParty/flute"), "5th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), - new Param("note6", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, -1, 1, 4, "launchParty/flute"), "6th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), - new Param("note7", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 1, 4, "launchParty/flute"), "7th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), - new Param("note8", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, -1, 1, 4, "launchParty/flute"), "8th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), - new Param("note9", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 1, 4, "launchParty/flute"), "9th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), - new Param("note10", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, -1, 1, 4, "launchParty/flute"), "10th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), - new Param("note11", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 1, 4, "launchParty/flute"), "11th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), - new Param("note12", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, -1, 1, 4, "launchParty/flute"), "12th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), - new Param("note13", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 1, 4, "launchParty/flute"), "13th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), - new Param("note14", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 7, 1, 4, "launchParty/flute"), "14th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), - new Param("note15", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 7, 1, 4, "launchParty/pin"), "15th Note", "The number of semitones up or down this note should be pitched") + new Param("note1", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 5, 0, 4, "launchParty/pin"), "1st Note", "Set the number of semitones up or down this note should be pitched."), + new Param("note2", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, -1, 0, 4, "launchParty/flute"), "2nd Note (Flute)", "Set the number of semitones up or down this note should be pitched."), + new Param("note3", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 0, 4, "launchParty/flute"), "3rd Note (Flute)", "Set the number of semitones up or down this note should be pitched."), + new Param("note4", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, -1, 0, 4, "launchParty/flute"), "4th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), + new Param("note5", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 0, 4, "launchParty/flute"), "5th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), + new Param("note6", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, -1, 0, 4, "launchParty/flute"), "6th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), + new Param("note7", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 0, 4, "launchParty/flute"), "7th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), + new Param("note8", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, -1, 0, 4, "launchParty/flute"), "8th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), + new Param("note9", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 0, 4, "launchParty/flute"), "9th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), + new Param("note10", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, -1, 0, 4, "launchParty/flute"), "10th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), + new Param("note11", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 0, 4, "launchParty/flute"), "11th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), + new Param("note12", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, -1, 0, 4, "launchParty/flute"), "12th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), + new Param("note13", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 0, 4, "launchParty/flute"), "13th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), + new Param("note14", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 7, 0, 4, "launchParty/flute"), "14th Note (Flute)", "Set the number of semitones up or down this note should be pitched."), + new Param("note15", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 7, 0, 4, "launchParty/pin"), "15th Note", "The number of semitones up or down this note should be pitched") } }, new GameAction("posMove", "Change Launch Pad Position") diff --git a/Assets/Scripts/LevelEditor/EventSelector/PropertyPrefabs/NotePropertyPrefab.cs b/Assets/Scripts/LevelEditor/EventSelector/PropertyPrefabs/NotePropertyPrefab.cs index e489bc882..1fe9c63e4 100644 --- a/Assets/Scripts/LevelEditor/EventSelector/PropertyPrefabs/NotePropertyPrefab.cs +++ b/Assets/Scripts/LevelEditor/EventSelector/PropertyPrefabs/NotePropertyPrefab.cs @@ -13,22 +13,25 @@ public class NotePropertyPrefab : NumberPropertyPrefab public TMP_Text noteLabel; private Sound previewAudioSource; + private EntityTypes.Note note; + private int offsetFromC; public override void SetProperties(string propertyName, object type, string caption) { base.SetProperties(propertyName, type, caption); - EntityTypes.Note note = (EntityTypes.Note)type; + note = (EntityTypes.Note)type; slider.minValue = note.min; slider.maxValue = note.max; - _defaultValue = note.val; slider.wholeNumbers = true; - int offsetFromC = 3 - note.sampleNote; + offsetFromC = 3 - note.sampleNote; slider.value = Convert.ToSingle(parameterManager.entity[propertyName]) - offsetFromC; + _defaultValue = slider.value; + inputField.text = slider.value.ToString(); noteLabel.text = GetNoteText(note, (int)slider.value + offsetFromC); @@ -81,6 +84,11 @@ public class NotePropertyPrefab : NumberPropertyPrefab } ); } + + public void OnSelectSliderHandle() + { + PlayPreview(note, (int)slider.value + offsetFromC); + } private void PlayPreview(EntityTypes.Note note, int currentSemitones) { @@ -88,12 +96,7 @@ public class NotePropertyPrefab : NumberPropertyPrefab if (previewAudioSource != null) { - if (!previewAudioSource.available) - { - GameManager.instance.SoundObjects.Release(previewAudioSource); - } - - previewAudioSource.Stop(); + previewAudioSource.Stop(true); previewAudioSource = null; } diff --git a/Assets/Scripts/UI/LeftClickEvent.cs b/Assets/Scripts/UI/LeftClickEvent.cs new file mode 100644 index 000000000..eafdaa098 --- /dev/null +++ b/Assets/Scripts/UI/LeftClickEvent.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Events; +using UnityEngine.EventSystems; +using UnityEngine.UI; + +public class LeftClickEvent : Selectable +{ + public UnityEvent OnLeftClick; + public override void OnPointerDown(PointerEventData eventData) + { + base.OnPointerDown(eventData); + + if(eventData.button != PointerEventData.InputButton.Left) return; + OnLeftClick?.Invoke(); + } +} diff --git a/Assets/Scripts/UI/LeftClickEvent.cs.meta b/Assets/Scripts/UI/LeftClickEvent.cs.meta new file mode 100644 index 000000000..b65fdcf3a --- /dev/null +++ b/Assets/Scripts/UI/LeftClickEvent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e365c37b20b7e15458fab7eef4b17449 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Util/Sound.cs b/Assets/Scripts/Util/Sound.cs index 7fa6ded85..791732999 100644 --- a/Assets/Scripts/Util/Sound.cs +++ b/Assets/Scripts/Util/Sound.cs @@ -117,7 +117,6 @@ namespace HeavenStudio.Util { if (!ignoreConductorPause && !(cond.isPlaying || cond.isPaused)) { - Debug.Log("release 1"); GameManager.instance.SoundObjects.Release(this); return; } @@ -175,15 +174,11 @@ namespace HeavenStudio.Util { if (!ignoreConductorPause && !(cond.isPlaying || cond.isPaused)) { - Debug.Log("release2"); - GameManager.instance.SoundObjects.Release(this); return; } if (!(looping || paused || audioSource.isPlaying)) { - Debug.Log("release3"); - GameManager.instance.SoundObjects.Release(this); return; } @@ -239,8 +234,13 @@ namespace HeavenStudio.Util audioSource.UnPause(); } - public void Stop() + public void Stop(bool releaseToPool = false) { + if(releaseToPool && audioSource.isPlaying) + { + GameManager.instance.SoundObjects.Release(this); + } + available = true; played = false; paused = false;