com.amanotes.magictilescore 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +240 -0
- package/CHANGELOG.md.meta +7 -0
- package/Docs/Class-Hierarchy.md +729 -0
- package/Docs/Class-Hierarchy.md.meta +7 -0
- package/Docs/Component-Architecture.md +43 -0
- package/Docs/Component-Architecture.md.meta +7 -0
- package/Docs/File-Structure.md +327 -0
- package/Docs/File-Structure.md.meta +7 -0
- package/Docs/Game-Architecture.md +41 -0
- package/Docs/Game-Architecture.md.meta +7 -0
- package/Docs/Input-System-Guide.md +419 -0
- package/Docs/Input-System-Guide.md.meta +7 -0
- package/Docs/Knot-System-Guide.md +309 -0
- package/Docs/Knot-System-Guide.md.meta +7 -0
- package/Docs/Meta-System-Guide.md +249 -0
- package/Docs/Meta-System-Guide.md.meta +7 -0
- package/Docs/New-Game-Checklist.md +102 -0
- package/Docs/New-Game-Checklist.md.meta +7 -0
- package/Docs/README.md +37 -0
- package/Docs/README.md.meta +7 -0
- package/Docs/RhythmCore-Architecture.md +373 -0
- package/Docs/RhythmCore-Architecture.md.meta +7 -0
- package/Docs/RhythmCore-Customize-Guide.md +391 -0
- package/Docs/RhythmCore-Customize-Guide.md.meta +7 -0
- package/Docs/Understanding-Rhythm-Core.md +483 -0
- package/Docs/Understanding-Rhythm-Core.md.meta +7 -0
- package/Docs/VisualWarp-System-Guide.md +377 -0
- package/Docs/VisualWarp-System-Guide.md.meta +7 -0
- package/Docs/Widget2D-System-Guide.md +450 -0
- package/Docs/Widget2D-System-Guide.md.meta +7 -0
- package/Docs.meta +8 -0
- package/Editor/AdjustHueEditor.cs +90 -0
- package/Editor/AdjustHueEditor.cs.meta +11 -0
- package/Editor/ClassInstanceDrawer.cs +256 -0
- package/Editor/ClassInstanceDrawer.cs.meta +11 -0
- package/Editor/CollapsibleGroupEditor.cs +142 -0
- package/Editor/CollapsibleGroupEditor.cs.meta +11 -0
- package/Editor/ListSongNoteEditor.cs +317 -0
- package/Editor/ListSongNoteEditor.cs.meta +11 -0
- package/Editor/MagicTilesCore.Editor.asmdef +20 -0
- package/Editor/MagicTilesCore.Editor.asmdef.meta +7 -0
- package/Editor/MetaLogicDrawer.cs +488 -0
- package/Editor/MetaLogicDrawer.cs.meta +11 -0
- package/Editor/RhythmContextEditor.EditorDrawer.cs +46 -0
- package/Editor/RhythmContextEditor.EditorDrawer.cs.meta +3 -0
- package/Editor/RhythmContextEditor.cs +587 -0
- package/Editor/RhythmContextEditor.cs.meta +3 -0
- package/Editor/RhythmGameEditor.cs +45 -0
- package/Editor/RhythmGameEditor.cs.meta +11 -0
- package/Editor/RhythmTileEditor.cs +93 -0
- package/Editor/RhythmTileEditor.cs.meta +11 -0
- package/Editor/TagConfigDrawer.cs +30 -0
- package/Editor/TagConfigDrawer.cs.meta +11 -0
- package/Editor.meta +8 -0
- package/LICENSE.md +7 -0
- package/LICENSE.md.meta +7 -0
- package/README.md +88 -0
- package/README.md.meta +7 -0
- package/Runtime/AssemblyInfo.cs +4 -0
- package/Runtime/AssemblyInfo.cs.meta +11 -0
- package/Runtime/Input/Base/BaseTileInput.cs +44 -0
- package/Runtime/Input/Base/BaseTileInput.cs.meta +11 -0
- package/Runtime/Input/Base/IInputHandler.cs +11 -0
- package/Runtime/Input/Base/IInputHandler.cs.meta +11 -0
- package/Runtime/Input/Base/InputData.cs +94 -0
- package/Runtime/Input/Base/InputData.cs.meta +3 -0
- package/Runtime/Input/Base/InputDirection.cs +17 -0
- package/Runtime/Input/Base/InputDirection.cs.meta +3 -0
- package/Runtime/Input/Base/InputPhase.cs +4 -0
- package/Runtime/Input/Base/InputPhase.cs.meta +3 -0
- package/Runtime/Input/Base.meta +3 -0
- package/Runtime/Input/Components/DragInput.cs +44 -0
- package/Runtime/Input/Components/DragInput.cs.meta +11 -0
- package/Runtime/Input/Components/HoldInput.cs +75 -0
- package/Runtime/Input/Components/HoldInput.cs.meta +12 -0
- package/Runtime/Input/Components/SwipeInput.cs +45 -0
- package/Runtime/Input/Components/SwipeInput.cs.meta +12 -0
- package/Runtime/Input/Components/TouchInput.cs +31 -0
- package/Runtime/Input/Components/TouchInput.cs.meta +11 -0
- package/Runtime/Input/Components.meta +8 -0
- package/Runtime/Input.meta +8 -0
- package/Runtime/MagicTilesCore.asmdef +24 -0
- package/Runtime/MagicTilesCore.asmdef.meta +7 -0
- package/Runtime/MoodChange/AdjustHue.ComponentInfo.cs +12 -0
- package/Runtime/MoodChange/AdjustHue.ComponentInfo.cs.meta +3 -0
- package/Runtime/MoodChange/AdjustHue.MaterialInfo.cs +115 -0
- package/Runtime/MoodChange/AdjustHue.MaterialInfo.cs.meta +3 -0
- package/Runtime/MoodChange/AdjustHue.ParticleSystemInfo.cs +36 -0
- package/Runtime/MoodChange/AdjustHue.ParticleSystemInfo.cs.meta +3 -0
- package/Runtime/MoodChange/AdjustHue.SpriteRendererInfo.cs +28 -0
- package/Runtime/MoodChange/AdjustHue.SpriteRendererInfo.cs.meta +3 -0
- package/Runtime/MoodChange/AdjustHue.TrailRendererInfo.cs +37 -0
- package/Runtime/MoodChange/AdjustHue.TrailRendererInfo.cs.meta +3 -0
- package/Runtime/MoodChange/AdjustHue.cs +219 -0
- package/Runtime/MoodChange/AdjustHue.cs.meta +11 -0
- package/Runtime/MoodChange/ColorHueExtensions.cs +227 -0
- package/Runtime/MoodChange/ColorHueExtensions.cs.meta +3 -0
- package/Runtime/MoodChange/HueCache.cs +167 -0
- package/Runtime/MoodChange/HueCache.cs.meta +11 -0
- package/Runtime/MoodChange/MoodChange.cs +52 -0
- package/Runtime/MoodChange/MoodChange.cs.meta +3 -0
- package/Runtime/MoodChange.meta +3 -0
- package/Runtime/Physics/TriggerCallback.cs +21 -0
- package/Runtime/Physics/TriggerCallback.cs.meta +3 -0
- package/Runtime/Physics.meta +8 -0
- package/Runtime/Preset/AudioSourcePlayer/AudioSourcePlayer.cs +153 -0
- package/Runtime/Preset/AudioSourcePlayer/AudioSourcePlayer.cs.meta +11 -0
- package/Runtime/Preset/AudioSourcePlayer/AudioSourcePlayer.prefab +145 -0
- package/Runtime/Preset/AudioSourcePlayer/AudioSourcePlayer.prefab.meta +7 -0
- package/Runtime/Preset/AudioSourcePlayer.meta +8 -0
- package/Runtime/Preset/AudioTimeText/AudioTimeText.cs +22 -0
- package/Runtime/Preset/AudioTimeText/AudioTimeText.cs.meta +11 -0
- package/Runtime/Preset/AudioTimeText/AudioTimeText.prefab +188 -0
- package/Runtime/Preset/AudioTimeText/AudioTimeText.prefab.meta +7 -0
- package/Runtime/Preset/AudioTimeText.meta +8 -0
- package/Runtime/Preset/ParticleSystemPlayer/ParticleSystemPlayer.cs +32 -0
- package/Runtime/Preset/ParticleSystemPlayer/ParticleSystemPlayer.cs.meta +11 -0
- package/Runtime/Preset/ParticleSystemPlayer.meta +8 -0
- package/Runtime/Preset/RendererAlpha.cs +56 -0
- package/Runtime/Preset/RendererAlpha.cs.meta +11 -0
- package/Runtime/Preset/ScoreText/ScoreText.anim +198 -0
- package/Runtime/Preset/ScoreText/ScoreText.anim.meta +8 -0
- package/Runtime/Preset/ScoreText/ScoreText.cs +32 -0
- package/Runtime/Preset/ScoreText/ScoreText.cs.meta +11 -0
- package/Runtime/Preset/ScoreText/ScoreText_2D.prefab +170 -0
- package/Runtime/Preset/ScoreText/ScoreText_2D.prefab.meta +7 -0
- package/Runtime/Preset/ScoreText/ScoreText_3D.prefab +206 -0
- package/Runtime/Preset/ScoreText/ScoreText_3D.prefab.meta +7 -0
- package/Runtime/Preset/ScoreText.meta +8 -0
- package/Runtime/Preset/StartHint/StartHint.cs +26 -0
- package/Runtime/Preset/StartHint/StartHint.cs.meta +3 -0
- package/Runtime/Preset/StartHint.meta +8 -0
- package/Runtime/Preset/WowText/WowText.cs +38 -0
- package/Runtime/Preset/WowText/WowText.cs.meta +3 -0
- package/Runtime/Preset/WowText.meta +8 -0
- package/Runtime/Preset.meta +8 -0
- package/Runtime/Rhythm/Components/Controls.meta +8 -0
- package/Runtime/Rhythm/Components/Helper/CameraFollow.cs +28 -0
- package/Runtime/Rhythm/Components/Helper/CameraFollow.cs.meta +11 -0
- package/Runtime/Rhythm/Components/Helper/MeshSpriteSorter.cs +89 -0
- package/Runtime/Rhythm/Components/Helper/MeshSpriteSorter.cs.meta +11 -0
- package/Runtime/Rhythm/Components/Helper/RecycleLayoutZ.cs +74 -0
- package/Runtime/Rhythm/Components/Helper/RecycleLayoutZ.cs.meta +11 -0
- package/Runtime/Rhythm/Components/Helper.meta +8 -0
- package/Runtime/Rhythm/Components.meta +8 -0
- package/Runtime/Rhythm/Core/GameMode.cs +10 -0
- package/Runtime/Rhythm/Core/GameMode.cs.meta +3 -0
- package/Runtime/Rhythm/Core/IAudioPlayer.cs +16 -0
- package/Runtime/Rhythm/Core/IAudioPlayer.cs.meta +3 -0
- package/Runtime/Rhythm/Core/IRhythmBehaviour.cs +10 -0
- package/Runtime/Rhythm/Core/IRhythmBehaviour.cs.meta +3 -0
- package/Runtime/Rhythm/Core/RhythmBehaviour.cs +57 -0
- package/Runtime/Rhythm/Core/RhythmBehaviour.cs.meta +11 -0
- package/Runtime/Rhythm/Core/RhythmDebug.cs +48 -0
- package/Runtime/Rhythm/Core/RhythmDebug.cs.meta +11 -0
- package/Runtime/Rhythm/Core/RhythmGameT.cs +323 -0
- package/Runtime/Rhythm/Core/RhythmGameT.cs.meta +3 -0
- package/Runtime/Rhythm/Core/RhythmMatch.cs +65 -0
- package/Runtime/Rhythm/Core/RhythmMatch.cs.meta +11 -0
- package/Runtime/Rhythm/Core/RhythmTile.cs +77 -0
- package/Runtime/Rhythm/Core/RhythmTile.cs.meta +3 -0
- package/Runtime/Rhythm/Core/RhythmTileHandler.cs +59 -0
- package/Runtime/Rhythm/Core/RhythmTileHandler.cs.meta +3 -0
- package/Runtime/Rhythm/Core.meta +8 -0
- package/Runtime/Rhythm/Extensions/CollectionExtensions.cs +120 -0
- package/Runtime/Rhythm/Extensions/CollectionExtensions.cs.meta +11 -0
- package/Runtime/Rhythm/Extensions/ColliderExtensions.cs +27 -0
- package/Runtime/Rhythm/Extensions/ColliderExtensions.cs.meta +11 -0
- package/Runtime/Rhythm/Extensions/GameHandlerExtensions.cs +56 -0
- package/Runtime/Rhythm/Extensions/GameHandlerExtensions.cs.meta +11 -0
- package/Runtime/Rhythm/Extensions/GameObjectExtensions.cs +61 -0
- package/Runtime/Rhythm/Extensions/GameObjectExtensions.cs.meta +11 -0
- package/Runtime/Rhythm/Extensions/InputDirectionExtensions.cs +76 -0
- package/Runtime/Rhythm/Extensions/InputDirectionExtensions.cs.meta +11 -0
- package/Runtime/Rhythm/Extensions/MTCListExtensions.cs +127 -0
- package/Runtime/Rhythm/Extensions/MTCListExtensions.cs.meta +11 -0
- package/Runtime/Rhythm/Extensions/MeshRendererExtensions.cs +81 -0
- package/Runtime/Rhythm/Extensions/MeshRendererExtensions.cs.meta +11 -0
- package/Runtime/Rhythm/Extensions/ParticleSystemExtensions.cs +54 -0
- package/Runtime/Rhythm/Extensions/ParticleSystemExtensions.cs.meta +11 -0
- package/Runtime/Rhythm/Extensions.meta +8 -0
- package/Runtime/Rhythm/Game/MTCSongAutoStart.cs +40 -0
- package/Runtime/Rhythm/Game/MTCSongAutoStart.cs.meta +11 -0
- package/Runtime/Rhythm/Game/RhythmConfig.cs +68 -0
- package/Runtime/Rhythm/Game/RhythmConfig.cs.meta +11 -0
- package/Runtime/Rhythm/Game/RhythmContext.Api.cs +533 -0
- package/Runtime/Rhythm/Game/RhythmContext.Api.cs.meta +11 -0
- package/Runtime/Rhythm/Game/RhythmContext.Dev.cs +121 -0
- package/Runtime/Rhythm/Game/RhythmContext.Dev.cs.meta +11 -0
- package/Runtime/Rhythm/Game/RhythmContext.Initialization.cs +114 -0
- package/Runtime/Rhythm/Game/RhythmContext.Initialization.cs.meta +11 -0
- package/Runtime/Rhythm/Game/RhythmContext.Runtime.cs +126 -0
- package/Runtime/Rhythm/Game/RhythmContext.Runtime.cs.meta +11 -0
- package/Runtime/Rhythm/Game/RhythmContext.State.cs +221 -0
- package/Runtime/Rhythm/Game/RhythmContext.State.cs.meta +11 -0
- package/Runtime/Rhythm/Game/RhythmContext.Tile.cs +90 -0
- package/Runtime/Rhythm/Game/RhythmContext.Tile.cs.meta +11 -0
- package/Runtime/Rhythm/Game/RhythmContext.TimeMachine.cs +315 -0
- package/Runtime/Rhythm/Game/RhythmContext.TimeMachine.cs.meta +11 -0
- package/Runtime/Rhythm/Game/RhythmContext.cs +312 -0
- package/Runtime/Rhythm/Game/RhythmContext.cs.meta +11 -0
- package/Runtime/Rhythm/Game/RhythmContextExtensions.cs +91 -0
- package/Runtime/Rhythm/Game/RhythmContextExtensions.cs.meta +11 -0
- package/Runtime/Rhythm/Game/Tile/ITileProgress.cs +7 -0
- package/Runtime/Rhythm/Game/Tile/ITileProgress.cs.meta +3 -0
- package/Runtime/Rhythm/Game/Tile/TileContext.cs +194 -0
- package/Runtime/Rhythm/Game/Tile/TileContext.cs.meta +11 -0
- package/Runtime/Rhythm/Game/Tile.meta +3 -0
- package/Runtime/Rhythm/Game.meta +3 -0
- package/Runtime/Rhythm/Math/Parabol.cs +35 -0
- package/Runtime/Rhythm/Math/Parabol.cs.meta +11 -0
- package/Runtime/Rhythm/Math.meta +8 -0
- package/Runtime/Rhythm/System/Event/GameEvent.cs +82 -0
- package/Runtime/Rhythm/System/Event/GameEvent.cs.meta +3 -0
- package/Runtime/Rhythm/System/Event.meta +8 -0
- package/Runtime/Rhythm/System/Meta/MetaLogic.cs +121 -0
- package/Runtime/Rhythm/System/Meta/MetaLogic.cs.meta +11 -0
- package/Runtime/Rhythm/System/Meta/VisualSpeedMeta.cs +132 -0
- package/Runtime/Rhythm/System/Meta/VisualSpeedMeta.cs.meta +11 -0
- package/Runtime/Rhythm/System/Meta.meta +8 -0
- package/Runtime/Rhythm/System/SongData/ListSongNote.cs +45 -0
- package/Runtime/Rhythm/System/SongData/ListSongNote.cs.meta +3 -0
- package/Runtime/Rhythm/System/SongData.meta +8 -0
- package/Runtime/Rhythm/System/StateMachine/RhythmStateMachine.State.cs +22 -0
- package/Runtime/Rhythm/System/StateMachine/RhythmStateMachine.State.cs.meta +11 -0
- package/Runtime/Rhythm/System/StateMachine/RhythmStateMachine.cs +138 -0
- package/Runtime/Rhythm/System/StateMachine/RhythmStateMachine.cs.meta +11 -0
- package/Runtime/Rhythm/System/StateMachine.meta +8 -0
- package/Runtime/Rhythm/System/TimeKnot/ListTimeKnots.cs +135 -0
- package/Runtime/Rhythm/System/TimeKnot/ListTimeKnots.cs.meta +11 -0
- package/Runtime/Rhythm/System/TimeKnot.meta +8 -0
- package/Runtime/Rhythm/System/TimeMachine/MTCTimeInterpolator.cs +365 -0
- package/Runtime/Rhythm/System/TimeMachine/MTCTimeInterpolator.cs.meta +11 -0
- package/Runtime/Rhythm/System/TimeMachine/MTCTimeMachine.TimeMarker.cs +107 -0
- package/Runtime/Rhythm/System/TimeMachine/MTCTimeMachine.TimeMarker.cs.meta +3 -0
- package/Runtime/Rhythm/System/TimeMachine/MTCTimeMachine.TimeNode.cs +14 -0
- package/Runtime/Rhythm/System/TimeMachine/MTCTimeMachine.TimeNode.cs.meta +3 -0
- package/Runtime/Rhythm/System/TimeMachine/MTCTimeMachine.TimeSpanNode.cs +21 -0
- package/Runtime/Rhythm/System/TimeMachine/MTCTimeMachine.TimeSpanNode.cs.meta +3 -0
- package/Runtime/Rhythm/System/TimeMachine/MTCTimeMachine.ZLaneSpeed.cs +28 -0
- package/Runtime/Rhythm/System/TimeMachine/MTCTimeMachine.ZLaneSpeed.cs.meta +3 -0
- package/Runtime/Rhythm/System/TimeMachine/MTCTimeMachine.cs +131 -0
- package/Runtime/Rhythm/System/TimeMachine/MTCTimeMachine.cs.meta +11 -0
- package/Runtime/Rhythm/System/TimeMachine.meta +8 -0
- package/Runtime/Rhythm/System/VisualKnot/VisualKnotLogic.cs +160 -0
- package/Runtime/Rhythm/System/VisualKnot/VisualKnotLogic.cs.meta +11 -0
- package/Runtime/Rhythm/System/VisualKnot.meta +8 -0
- package/Runtime/Rhythm/System/VisualWarp/IVisualWarp.cs +10 -0
- package/Runtime/Rhythm/System/VisualWarp/IVisualWarp.cs.meta +11 -0
- package/Runtime/Rhythm/System/VisualWarp/LinearVisualWarp.cs +27 -0
- package/Runtime/Rhythm/System/VisualWarp/LinearVisualWarp.cs.meta +11 -0
- package/Runtime/Rhythm/System/VisualWarp.meta +8 -0
- package/Runtime/Rhythm/System.meta +8 -0
- package/Runtime/Rhythm.meta +8 -0
- package/Runtime.meta +8 -0
- package/package.json +12 -0
- package/package.json.meta +7 -0
|
@@ -0,0 +1,587 @@
|
|
|
1
|
+
using System.Collections.Generic;
|
|
2
|
+
using System.Linq;
|
|
3
|
+
using System.Reflection;
|
|
4
|
+
using UnityEditor;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
using UnityEngine.Profiling;
|
|
7
|
+
using Amanotes.Core;
|
|
8
|
+
using static Amanotes.Core.RhythmJson;
|
|
9
|
+
namespace Amanotes.MagicTilesCore
|
|
10
|
+
{
|
|
11
|
+
[CustomEditor(typeof(RhythmContext), true)]
|
|
12
|
+
public partial class RhythmContextEditor : Editor
|
|
13
|
+
{
|
|
14
|
+
private int _selectedTab = 0;
|
|
15
|
+
private readonly string[] _tabNames = { "Config", "Pool", "Extra", "Debug" };
|
|
16
|
+
private int _selectedDebugTab = 0;
|
|
17
|
+
private readonly string[] _debugTabNames = { "Registered Views", "Runtime", "Active Tile" };
|
|
18
|
+
private static int _selectedNoteIndex = 0;
|
|
19
|
+
private List<EditorDrawer> _configEditorDrawers;
|
|
20
|
+
private EditorDrawer _rhythmConfigEditorDrawer;
|
|
21
|
+
private bool _metaSystemsExpanded = true;
|
|
22
|
+
private bool _listNoteDataExpanded = true;
|
|
23
|
+
private ClassInstanceDrawer _matchDataDrawer;
|
|
24
|
+
private ClassInstanceDrawer _rhythmContextDrawer;
|
|
25
|
+
private ClassInstanceDrawer _tileContextDrawer;
|
|
26
|
+
private ClassInstanceDrawer _songNotesDrawer;
|
|
27
|
+
private ClassInstanceDrawer _listNoteDataDrawer;
|
|
28
|
+
|
|
29
|
+
private static readonly HashSet<string> _matchDataForceHideMembers = new HashSet<string> { "context" };
|
|
30
|
+
private static readonly HashSet<string> _rhythmContextForceHideMembers = new HashSet<string> { "_config" };
|
|
31
|
+
private static readonly HashSet<string> _tileContextForceShowMembers = new HashSet<string> { "note" };
|
|
32
|
+
|
|
33
|
+
private List<ConfigGroup> _configGroups = new List<ConfigGroup>();
|
|
34
|
+
private ScriptableObject _lastConfig = null;
|
|
35
|
+
private int _selectedConfigTab = 0;
|
|
36
|
+
|
|
37
|
+
private class ConfigGroup
|
|
38
|
+
{
|
|
39
|
+
public System.Type groupType;
|
|
40
|
+
public string title;
|
|
41
|
+
public bool isExpanded;
|
|
42
|
+
public List<string> propertyNames;
|
|
43
|
+
|
|
44
|
+
public ConfigGroup(System.Type type, string title)
|
|
45
|
+
{
|
|
46
|
+
this.groupType = type;
|
|
47
|
+
this.title = title;
|
|
48
|
+
this.isExpanded = true;
|
|
49
|
+
this.propertyNames = new List<string>();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
private void OnEnable()
|
|
54
|
+
{
|
|
55
|
+
var context = (RhythmContext)target;
|
|
56
|
+
_selectedTab = context._editorSelectedTab;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public override void OnInspectorGUI()
|
|
60
|
+
{
|
|
61
|
+
serializedObject.Update();
|
|
62
|
+
|
|
63
|
+
var context = (RhythmContext)target;
|
|
64
|
+
var config = (serializedObject.targetObject as RhythmContext)._config;
|
|
65
|
+
if (config == null)
|
|
66
|
+
{
|
|
67
|
+
EditorGUILayout.HelpBox("Config is null - Please assign a RhythmConfig and ListSongNote", MessageType.Warning);
|
|
68
|
+
|
|
69
|
+
// Show object fields for drag & drop when config is null
|
|
70
|
+
EditorGUILayout.Space();
|
|
71
|
+
EditorGUILayout.LabelField("Assign Required Assets:", EditorStyles.boldLabel);
|
|
72
|
+
|
|
73
|
+
// Config object field
|
|
74
|
+
var configProperty = serializedObject.FindProperty("_config");
|
|
75
|
+
if (configProperty != null)
|
|
76
|
+
{
|
|
77
|
+
EditorGUILayout.PropertyField(configProperty, new GUIContent("Game Config"));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Song Notes object field
|
|
81
|
+
var songNotesProperty = serializedObject.FindProperty("_songNotes");
|
|
82
|
+
if (songNotesProperty != null)
|
|
83
|
+
{
|
|
84
|
+
EditorGUILayout.PropertyField(songNotesProperty, new GUIContent("Song Notes"));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
serializedObject.ApplyModifiedProperties();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
var configSO = new SerializedObject(config);
|
|
92
|
+
configSO.Update();
|
|
93
|
+
|
|
94
|
+
var originalLabelWidth = EditorGUIUtility.labelWidth;
|
|
95
|
+
|
|
96
|
+
DrawGameController(context);
|
|
97
|
+
GUILayout.Space(16f);
|
|
98
|
+
|
|
99
|
+
int newSelectedTab = GUILayout.Toolbar(_selectedTab, _tabNames, GUILayout.Height(30));
|
|
100
|
+
if (newSelectedTab != _selectedTab)
|
|
101
|
+
{
|
|
102
|
+
_selectedTab = newSelectedTab;
|
|
103
|
+
// Save tab selection to ScriptableObject (persistent across edit/play mode)
|
|
104
|
+
context._editorSelectedTab = _selectedTab;
|
|
105
|
+
EditorUtility.SetDirty(context); // Mark as dirty to save changes
|
|
106
|
+
}
|
|
107
|
+
EditorGUILayout.Space();
|
|
108
|
+
|
|
109
|
+
switch (_selectedTab)
|
|
110
|
+
{
|
|
111
|
+
case 0: DrawConfigTab(context); break;
|
|
112
|
+
case 1: DrawPoolTab(configSO); break;
|
|
113
|
+
case 2: DrawExtraTab(context); break;
|
|
114
|
+
case 3:
|
|
115
|
+
{
|
|
116
|
+
DrawDebugTab(context, configSO);
|
|
117
|
+
}
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (GUI.changed)
|
|
122
|
+
{
|
|
123
|
+
EditorUtility.SetDirty(target);
|
|
124
|
+
serializedObject.ApplyModifiedProperties();
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
EditorGUIUtility.labelWidth = originalLabelWidth;
|
|
128
|
+
if (Application.isPlaying) Repaint();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
private void DrawConfigTab(RhythmContext context)
|
|
132
|
+
{
|
|
133
|
+
DrawSongNotesWithDetails(context);
|
|
134
|
+
EditorGUILayout.Space(8f);
|
|
135
|
+
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(RhythmContext._config)), false, GUILayout.Height(EditorGUIUtility.singleLineHeight));
|
|
136
|
+
if (context._config != null)
|
|
137
|
+
{
|
|
138
|
+
DrawConfigWithGrouping(context._config);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
private void DrawConfigWithGrouping(ScriptableObject config)
|
|
143
|
+
{
|
|
144
|
+
if (config == null) return;
|
|
145
|
+
|
|
146
|
+
GroupConfigPropertiesByInheritance(config);
|
|
147
|
+
|
|
148
|
+
var configSO = new SerializedObject(config);
|
|
149
|
+
configSO.Update();
|
|
150
|
+
|
|
151
|
+
// Create tab names from inheritance chain
|
|
152
|
+
var tabNames = _configGroups.Where(g => g.propertyNames.Count > 0).Select(g => g.title).ToArray();
|
|
153
|
+
|
|
154
|
+
if (tabNames.Length > 0)
|
|
155
|
+
{
|
|
156
|
+
// Ensure selected tab is within bounds
|
|
157
|
+
_selectedConfigTab = Mathf.Clamp(_selectedConfigTab, 0, tabNames.Length - 1);
|
|
158
|
+
|
|
159
|
+
// Draw child tab toolbar with default height
|
|
160
|
+
_selectedConfigTab = GUILayout.Toolbar(_selectedConfigTab, tabNames);
|
|
161
|
+
|
|
162
|
+
// Draw properties for the selected tab with 1 level indentation
|
|
163
|
+
var selectedGroup = _configGroups.Where(g => g.propertyNames.Count > 0).ElementAtOrDefault(_selectedConfigTab);
|
|
164
|
+
if (selectedGroup != null)
|
|
165
|
+
{
|
|
166
|
+
EditorGUI.indentLevel++;
|
|
167
|
+
foreach (var propertyName in selectedGroup.propertyNames)
|
|
168
|
+
{
|
|
169
|
+
var property = configSO.FindProperty(propertyName);
|
|
170
|
+
if (property != null)
|
|
171
|
+
{
|
|
172
|
+
EditorGUILayout.PropertyField(property, true);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
EditorGUI.indentLevel--;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
configSO.ApplyModifiedProperties();
|
|
180
|
+
|
|
181
|
+
// Trigger config change callback during play time when config values change
|
|
182
|
+
if (GUI.changed && Application.isPlaying)
|
|
183
|
+
{
|
|
184
|
+
var context = (RhythmContext)target;
|
|
185
|
+
context.OnGameConfigChange?.Invoke();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
private void GroupConfigPropertiesByInheritance(ScriptableObject config)
|
|
190
|
+
{
|
|
191
|
+
if (_configGroups.Count == 0 || _lastConfig != config)
|
|
192
|
+
{
|
|
193
|
+
_lastConfig = config;
|
|
194
|
+
_configGroups.Clear();
|
|
195
|
+
|
|
196
|
+
var configType = config.GetType();
|
|
197
|
+
var inheritanceChain = GetInheritanceChain(configType);
|
|
198
|
+
|
|
199
|
+
foreach (var type in inheritanceChain)
|
|
200
|
+
{
|
|
201
|
+
var group = new ConfigGroup(type, type.Name);
|
|
202
|
+
_configGroups.Add(group);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
var serializedObject = new SerializedObject(config);
|
|
206
|
+
var iterator = serializedObject.GetIterator();
|
|
207
|
+
|
|
208
|
+
if (iterator.NextVisible(true))
|
|
209
|
+
{
|
|
210
|
+
while (iterator.NextVisible(false))
|
|
211
|
+
{
|
|
212
|
+
if (iterator.depth > 0) continue;
|
|
213
|
+
|
|
214
|
+
var fieldInfo = GetDirectFieldInfo(configType, iterator.propertyPath);
|
|
215
|
+
if (fieldInfo != null)
|
|
216
|
+
{
|
|
217
|
+
var declaringType = fieldInfo.DeclaringType;
|
|
218
|
+
var group = _configGroups.FirstOrDefault(g => g.groupType == declaringType);
|
|
219
|
+
|
|
220
|
+
if (group != null)
|
|
221
|
+
{
|
|
222
|
+
group.propertyNames.Add(iterator.propertyPath);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
private List<System.Type> GetInheritanceChain(System.Type type)
|
|
231
|
+
{
|
|
232
|
+
var chain = new List<System.Type>();
|
|
233
|
+
var current = type;
|
|
234
|
+
|
|
235
|
+
while (current != null && current != typeof(ScriptableObject) && current != typeof(UnityEngine.Object))
|
|
236
|
+
{
|
|
237
|
+
chain.Add(current);
|
|
238
|
+
current = current.BaseType;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// Reverse to get base classes first
|
|
242
|
+
chain.Reverse();
|
|
243
|
+
return chain;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
private FieldInfo GetDirectFieldInfo(System.Type type, string propertyPath)
|
|
247
|
+
{
|
|
248
|
+
// For direct fields, just get the field directly
|
|
249
|
+
return type.GetField(propertyPath, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
private void DrawPoolTab(SerializedObject configSO)
|
|
256
|
+
{
|
|
257
|
+
EditorGUILayout.PropertyField(configSO.FindProperty(nameof(RhythmContext.tilePoolGroup)), true);
|
|
258
|
+
EditorGUILayout.PropertyField(configSO.FindProperty(nameof(RhythmContext.vfxPoolGroup)), true);
|
|
259
|
+
EditorGUILayout.PropertyField(configSO.FindProperty(nameof(RhythmContext.excludeFromAutoPlay)), true);
|
|
260
|
+
|
|
261
|
+
// Always apply changes and mark dirty
|
|
262
|
+
if (GUI.changed)
|
|
263
|
+
{
|
|
264
|
+
configSO.ApplyModifiedProperties();
|
|
265
|
+
EditorUtility.SetDirty(configSO.targetObject);
|
|
266
|
+
|
|
267
|
+
// Trigger config change callback during play time
|
|
268
|
+
if (Application.isPlaying)
|
|
269
|
+
{
|
|
270
|
+
var context = (RhythmContext)target;
|
|
271
|
+
context.OnGameConfigChange?.Invoke();
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
private void DrawExtraTab(RhythmContext context)
|
|
277
|
+
{
|
|
278
|
+
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(RhythmContext._gameConfigs)), true);
|
|
279
|
+
DrawGameConfigsList(context);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
private void DrawGameConfigsList(RhythmContext context)
|
|
284
|
+
{
|
|
285
|
+
// Initialize or update editor drawers
|
|
286
|
+
if (_configEditorDrawers == null)
|
|
287
|
+
{
|
|
288
|
+
_configEditorDrawers = new List<EditorDrawer>();
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// Clean up drawers for removed configs
|
|
292
|
+
for (int i = _configEditorDrawers.Count - 1; i >= 0; i--)
|
|
293
|
+
{
|
|
294
|
+
var drawer = _configEditorDrawers[i];
|
|
295
|
+
if (drawer.target == null || !context._gameConfigs.Contains(drawer.target))
|
|
296
|
+
{
|
|
297
|
+
drawer.Dispose();
|
|
298
|
+
_configEditorDrawers.RemoveAt(i);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// Create drawers for new configs
|
|
303
|
+
foreach (var config in context._gameConfigs)
|
|
304
|
+
{
|
|
305
|
+
if (config == null) continue;
|
|
306
|
+
|
|
307
|
+
var existingDrawer = _configEditorDrawers.Find(d => d.target == config);
|
|
308
|
+
if (existingDrawer == null)
|
|
309
|
+
{
|
|
310
|
+
_configEditorDrawers.Add(new EditorDrawer(config));
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// Draw all editor drawers
|
|
315
|
+
foreach (var drawer in _configEditorDrawers)
|
|
316
|
+
{
|
|
317
|
+
drawer.Draw();
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
private void OnDisable()
|
|
322
|
+
{
|
|
323
|
+
if (_configEditorDrawers == null) return;
|
|
324
|
+
foreach (var drawer in _configEditorDrawers)
|
|
325
|
+
{
|
|
326
|
+
drawer.Dispose();
|
|
327
|
+
}
|
|
328
|
+
_configEditorDrawers = null;
|
|
329
|
+
|
|
330
|
+
_rhythmConfigEditorDrawer?.Dispose();
|
|
331
|
+
_rhythmConfigEditorDrawer = null;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
private void DrawDebugTags(SerializedObject configSO)
|
|
335
|
+
{
|
|
336
|
+
var debugTagsProp = configSO.FindProperty("debugTags");
|
|
337
|
+
if (debugTagsProp != null)
|
|
338
|
+
{
|
|
339
|
+
EditorGUILayout.PropertyField(debugTagsProp, true);
|
|
340
|
+
configSO.ApplyModifiedProperties();
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
private bool _registeredViewsExpanded = true;
|
|
345
|
+
|
|
346
|
+
private void DrawRegisteredViews(RhythmContext context)
|
|
347
|
+
{
|
|
348
|
+
var registeredViews = context._registeredViews;
|
|
349
|
+
int viewCount = registeredViews?.Count ?? 0;
|
|
350
|
+
|
|
351
|
+
_registeredViewsExpanded = EditorGUILayout.Foldout(_registeredViewsExpanded, $"Registered Views ({viewCount})");
|
|
352
|
+
|
|
353
|
+
if (_registeredViewsExpanded)
|
|
354
|
+
{
|
|
355
|
+
if (registeredViews == null || registeredViews.Count == 0)
|
|
356
|
+
{
|
|
357
|
+
EditorGUILayout.HelpBox("No registered views", MessageType.Info);
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
for (int i = 0; i < registeredViews.Count; i++)
|
|
362
|
+
{
|
|
363
|
+
var view = registeredViews[i];
|
|
364
|
+
if (view == null)
|
|
365
|
+
{
|
|
366
|
+
EditorGUILayout.LabelField($"[{i}] <null>");
|
|
367
|
+
continue;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
string viewName = view.GetType().Name;
|
|
371
|
+
string priorityText = view is IRhythmBehaviourPriority priorityInterface ?
|
|
372
|
+
$" (Priority: {priorityInterface.Priority})" : "";
|
|
373
|
+
|
|
374
|
+
EditorGUI.BeginDisabledGroup(true);
|
|
375
|
+
EditorGUILayout.ObjectField($"[{i}] {viewName}{priorityText}", view as UnityEngine.Object, view.GetType(), true);
|
|
376
|
+
EditorGUI.EndDisabledGroup();
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
private void DrawGameController(RhythmContext context)
|
|
383
|
+
{
|
|
384
|
+
if (!Application.isPlaying)
|
|
385
|
+
{
|
|
386
|
+
EditorGUILayout.BeginHorizontal();
|
|
387
|
+
context.isAutoPlay = EditorGUILayout.ToggleLeft("Auto", context.isAutoPlay, GUILayout.Width(60));
|
|
388
|
+
if (GUILayout.Button("▶ Enter Play Mode", GUILayout.Height(30)))
|
|
389
|
+
{
|
|
390
|
+
EditorApplication.isPlaying = true;
|
|
391
|
+
}
|
|
392
|
+
EditorGUILayout.EndHorizontal();
|
|
393
|
+
}
|
|
394
|
+
else
|
|
395
|
+
{
|
|
396
|
+
// Draw time slider FIRST (topmost) - even before audio speed
|
|
397
|
+
DrawTimeSlider(context);
|
|
398
|
+
EditorGUILayout.Space(8f);
|
|
399
|
+
|
|
400
|
+
// Audio Speed after time slider
|
|
401
|
+
context.audioSpeed = EditorGUILayout.Slider("Audio Speed", context.audioSpeed, 0.01f, 10f);
|
|
402
|
+
|
|
403
|
+
// Auto Play + Stop/Pause buttons
|
|
404
|
+
EditorGUILayout.BeginHorizontal();
|
|
405
|
+
{
|
|
406
|
+
context.isAutoPlay = EditorGUILayout.ToggleLeft("Auto", context.isAutoPlay, GUILayout.Width(60));
|
|
407
|
+
|
|
408
|
+
bool canStop = context.gameTime > 0.1f;
|
|
409
|
+
EditorGUI.BeginDisabledGroup(!canStop);
|
|
410
|
+
if (GUILayout.Button("STOP", GUILayout.Height(30)))
|
|
411
|
+
{
|
|
412
|
+
context.StopGame();
|
|
413
|
+
}
|
|
414
|
+
EditorGUI.EndDisabledGroup();
|
|
415
|
+
|
|
416
|
+
if (GUILayout.Button(context.IsPlaying ? "▐▐" : "▶", GUILayout.Width(40), GUILayout.Height(30)))
|
|
417
|
+
{
|
|
418
|
+
if (!context.IsPlaying)
|
|
419
|
+
{
|
|
420
|
+
if (context.GameState != GameEvent.GAME_READY && context.GameState != GameEvent.GAME_STOP)
|
|
421
|
+
{
|
|
422
|
+
context.ResumeGame();
|
|
423
|
+
}
|
|
424
|
+
else
|
|
425
|
+
{
|
|
426
|
+
context.StartGame();
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
else
|
|
430
|
+
{
|
|
431
|
+
context.PauseGame();
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
EditorGUILayout.EndHorizontal();
|
|
436
|
+
|
|
437
|
+
// Draw Meta Systems after controls
|
|
438
|
+
EditorGUILayout.Space(8f);
|
|
439
|
+
DrawMetaSystems(context);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
private void DrawTimeSlider(RhythmContext ctx)
|
|
444
|
+
{
|
|
445
|
+
if (!Application.isPlaying || ctx == null) return;
|
|
446
|
+
|
|
447
|
+
float maxTime = ctx.audioDuration > 0 ? ctx.audioDuration : 60f;
|
|
448
|
+
float currentTime = ctx.audioTime;
|
|
449
|
+
|
|
450
|
+
EditorGUILayout.BeginHorizontal();
|
|
451
|
+
EditorGUILayout.LabelField("Time:", GUILayout.Width(40));
|
|
452
|
+
EditorGUILayout.LabelField($"{currentTime:F2}s", GUILayout.Width(50));
|
|
453
|
+
|
|
454
|
+
// Time slider for seeking
|
|
455
|
+
float newTime = EditorGUILayout.Slider(currentTime, 0f, maxTime);
|
|
456
|
+
if (!Mathf.Approximately(newTime, currentTime))
|
|
457
|
+
{
|
|
458
|
+
ctx.SeekToAudioTime(newTime);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
EditorGUILayout.LabelField($"/ {maxTime:F2}s", GUILayout.Width(60));
|
|
462
|
+
EditorGUILayout.EndHorizontal();
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
private void DrawMetaSystems(RhythmContext ctx)
|
|
466
|
+
{
|
|
467
|
+
if (!Application.isPlaying) return;
|
|
468
|
+
|
|
469
|
+
// Skip if no meta data exists
|
|
470
|
+
if (ctx.gameMetas == null || ctx.gameMetas.Count == 0) return;
|
|
471
|
+
|
|
472
|
+
// Let MetaLogicDrawer handle ALL the complexity and caching
|
|
473
|
+
MetaLogicDrawer.DrawMetaSystemsGroup(ctx, ref _metaSystemsExpanded);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
private void DrawMatchData(RhythmContext context)
|
|
477
|
+
{
|
|
478
|
+
if (context.matchData == null)
|
|
479
|
+
return;
|
|
480
|
+
|
|
481
|
+
// Initialize drawer if needed
|
|
482
|
+
if (_matchDataDrawer == null)
|
|
483
|
+
{
|
|
484
|
+
_matchDataDrawer = new ClassInstanceDrawer(context.matchData.GetType(), drawProperties: false, forceHideMembers: _matchDataForceHideMembers);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
_matchDataDrawer.Draw(context.matchData, "Match Data");
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
private void DrawRhythmContext(RhythmContext context)
|
|
491
|
+
{
|
|
492
|
+
if (context == null)
|
|
493
|
+
return;
|
|
494
|
+
|
|
495
|
+
// Initialize drawer if needed
|
|
496
|
+
if (_rhythmContextDrawer == null)
|
|
497
|
+
{
|
|
498
|
+
_rhythmContextDrawer = new ClassInstanceDrawer(typeof(RhythmContext), drawProperties: false, forceHideMembers: _rhythmContextForceHideMembers);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
_rhythmContextDrawer.Draw(context, "Rhythm Context");
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
private void DrawTileContext(RhythmContext context)
|
|
505
|
+
{
|
|
506
|
+
// Initialize drawer if needed - create once, reuse always
|
|
507
|
+
if (_tileContextDrawer == null)
|
|
508
|
+
{
|
|
509
|
+
_tileContextDrawer = new ClassInstanceDrawer(drawProperties: false, forceShowMembers: _tileContextForceShowMembers);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
// Get first touchable tile
|
|
513
|
+
var firstActiveTile = context?.GetFirstActiveTileContext();
|
|
514
|
+
|
|
515
|
+
// Always draw the TileContext group, even if instance is null
|
|
516
|
+
_tileContextDrawer.Draw(firstActiveTile, "First Active Tile Context");
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
private void DrawSongNotesWithDetails(RhythmContext context)
|
|
520
|
+
{
|
|
521
|
+
var songNotesProp = serializedObject.FindProperty(nameof(RhythmContext._songNotes));
|
|
522
|
+
_listNoteDataExpanded = EditorGUILayout.Foldout(_listNoteDataExpanded, GUIContent.none);
|
|
523
|
+
var rect = GUILayoutUtility.GetLastRect();
|
|
524
|
+
EditorGUI.PropertyField(rect, songNotesProp, EditorGUIUtility.TrTempContent("Song Notes"), true);
|
|
525
|
+
|
|
526
|
+
// Draw expandable details if song notes exist and foldout is expanded
|
|
527
|
+
if (!_listNoteDataExpanded) return;
|
|
528
|
+
|
|
529
|
+
if (context?.songNotes == null)
|
|
530
|
+
{
|
|
531
|
+
EditorGUILayout.HelpBox("No Song Notes available", MessageType.Info);
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
var songNotes = context.songNotes;
|
|
536
|
+
int noteCount = songNotes.noteCount;
|
|
537
|
+
|
|
538
|
+
if (noteCount == 0)
|
|
539
|
+
{
|
|
540
|
+
EditorGUILayout.HelpBox("Song Notes is empty", MessageType.Info);
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
EditorGUI.indentLevel++;
|
|
545
|
+
{
|
|
546
|
+
if (_listNoteDataDrawer == null)
|
|
547
|
+
_listNoteDataDrawer = new ClassInstanceDrawer(typeof(SongNote), drawProperties: false);
|
|
548
|
+
var note = songNotes.GetNoteAt(_selectedNoteIndex);
|
|
549
|
+
if (note != null)
|
|
550
|
+
{
|
|
551
|
+
_selectedNoteIndex = EditorGUILayout.IntSlider("Note Index", _selectedNoteIndex, 0, noteCount - 1);
|
|
552
|
+
EditorGUILayout.Space();
|
|
553
|
+
_listNoteDataDrawer.Draw(note, "");
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
EditorGUI.indentLevel--;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
private void DrawDebugTab(RhythmContext context, SerializedObject configSO)
|
|
560
|
+
{
|
|
561
|
+
// Draw debug tags above sub-tabs
|
|
562
|
+
DrawDebugTags(configSO);
|
|
563
|
+
|
|
564
|
+
// Draw debug sub-tabs
|
|
565
|
+
_selectedDebugTab = GUILayout.Toolbar(_selectedDebugTab, _debugTabNames);
|
|
566
|
+
EditorGUILayout.Space();
|
|
567
|
+
|
|
568
|
+
// Indent sub-tab content
|
|
569
|
+
EditorGUI.indentLevel++;
|
|
570
|
+
switch (_selectedDebugTab)
|
|
571
|
+
{
|
|
572
|
+
case 0: // Registered Views
|
|
573
|
+
DrawRegisteredViews(context);
|
|
574
|
+
break;
|
|
575
|
+
case 1: // Runtime
|
|
576
|
+
DrawMatchData(context);
|
|
577
|
+
DrawRhythmContext(context);
|
|
578
|
+
break;
|
|
579
|
+
case 2: // Active Tile
|
|
580
|
+
DrawTileContext(context);
|
|
581
|
+
break;
|
|
582
|
+
}
|
|
583
|
+
EditorGUI.indentLevel--;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
}
|
|
587
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
using UnityEditor;
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
|
|
4
|
+
namespace Amanotes.MagicTilesCore
|
|
5
|
+
{
|
|
6
|
+
[CustomEditor(typeof(RhythmGame), true)]
|
|
7
|
+
public class RhythmGameEditor : Editor
|
|
8
|
+
{
|
|
9
|
+
private RhythmContextEditor.EditorDrawer _contextEditorDrawer;
|
|
10
|
+
|
|
11
|
+
public override void OnInspectorGUI()
|
|
12
|
+
{
|
|
13
|
+
serializedObject.Update();
|
|
14
|
+
|
|
15
|
+
var rhythmGame = (RhythmGame)target;
|
|
16
|
+
DrawDefaultInspector();
|
|
17
|
+
|
|
18
|
+
if (rhythmGame.context == null)
|
|
19
|
+
{
|
|
20
|
+
EditorGUILayout.HelpBox("No Game Context assigned", MessageType.Warning);
|
|
21
|
+
}
|
|
22
|
+
else
|
|
23
|
+
{
|
|
24
|
+
if (_contextEditorDrawer == null || _contextEditorDrawer.target != rhythmGame.context)
|
|
25
|
+
{
|
|
26
|
+
_contextEditorDrawer?.Dispose();
|
|
27
|
+
_contextEditorDrawer = new RhythmContextEditor.EditorDrawer(rhythmGame.context);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
_contextEditorDrawer.Draw();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (GUI.changed)
|
|
34
|
+
{
|
|
35
|
+
EditorUtility.SetDirty(target);
|
|
36
|
+
serializedObject.ApplyModifiedProperties();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
private void OnDisable()
|
|
41
|
+
{
|
|
42
|
+
_contextEditorDrawer?.Dispose();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|