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,450 @@
|
|
|
1
|
+
# Widget2D System Guide
|
|
2
|
+
|
|
3
|
+
## 🎯 System Overview
|
|
4
|
+
|
|
5
|
+
Widget2D provides a responsive UI layout system for Unity with automatic component resizing, screen adaptation, and flexible transformation pipelines. Core to rhythm games requiring precise positioning and scaling across different screen sizes.
|
|
6
|
+
|
|
7
|
+
## 🏗️ Core Architecture
|
|
8
|
+
|
|
9
|
+
### Widget2D (Base Component)
|
|
10
|
+
```csharp
|
|
11
|
+
public partial class Widget2D : MonoBehaviour
|
|
12
|
+
```
|
|
13
|
+
- **Component target system** with automatic size application to `RectTransform`, `SpriteRenderer`, `BoxCollider2D`, `TextMeshPro`
|
|
14
|
+
- **Listener notification** via `ISizeListener` interface for custom resize handling
|
|
15
|
+
- **Visual debugging** with configurable gizmos and editor tools
|
|
16
|
+
- **Partial class design** separating size management, component handling, and listener systems
|
|
17
|
+
|
|
18
|
+
### Screen2D (Screen Adaptation)
|
|
19
|
+
```csharp
|
|
20
|
+
public class Screen2D : Widget2D
|
|
21
|
+
```
|
|
22
|
+
**Responsive Features:**
|
|
23
|
+
- `fitWidthToHeight` (0-1) - Blend between fit-width and fit-height scaling
|
|
24
|
+
- **Runtime screen change detection** with automatic size updates
|
|
25
|
+
- **Original size preservation** for consistent scaling ratios
|
|
26
|
+
- **Aspect ratio calculation** maintaining visual consistency
|
|
27
|
+
|
|
28
|
+
### WidgetTransform (Layout System)
|
|
29
|
+
```csharp
|
|
30
|
+
public partial class WidgetTransform : MonoBehaviour, ISizeListener
|
|
31
|
+
```
|
|
32
|
+
**Transform Pipeline:**
|
|
33
|
+
1. **SizeHandler** - Source-relative sizing with ratio/delta controls
|
|
34
|
+
2. **ScaleHandler** - Transform scaling with fit/fill modes
|
|
35
|
+
3. **AlignHandler** - Position alignment with offset and self-align
|
|
36
|
+
|
|
37
|
+
## 🎮 Component Handler System
|
|
38
|
+
|
|
39
|
+
### WidgetHandler (Type Registry)
|
|
40
|
+
```csharp
|
|
41
|
+
public partial class WidgetHandler
|
|
42
|
+
```
|
|
43
|
+
**Supported Components:**
|
|
44
|
+
- `RectTransform` - `sizeDelta` property control
|
|
45
|
+
- `SpriteRenderer` - Direct size manipulation via `SetSize()`
|
|
46
|
+
- `BoxCollider2D/BoxCollider` - Scale-aware size calculation and application
|
|
47
|
+
- `TextMeshPro/TextMeshProUGUI` - RectTransform-based sizing
|
|
48
|
+
|
|
49
|
+
**Extensible Design:**
|
|
50
|
+
```csharp
|
|
51
|
+
WidgetHandler.RegisterHandler<YourComponent>(
|
|
52
|
+
(component, size) => {
|
|
53
|
+
// Custom size application logic
|
|
54
|
+
component.customProperty = size;
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 🎵 MT3 Tile System Integration
|
|
60
|
+
|
|
61
|
+
### TileContext - The Data Bridge
|
|
62
|
+
|
|
63
|
+
`TileContext` serves as the central data hub connecting rhythm game logic with visual tile representation:
|
|
64
|
+
|
|
65
|
+
```csharp
|
|
66
|
+
public sealed class TileContext
|
|
67
|
+
{
|
|
68
|
+
public readonly int index; // Tile sequence number
|
|
69
|
+
public readonly SongNote note; // Musical note data
|
|
70
|
+
public readonly RhythmContext context; // Game state reference
|
|
71
|
+
|
|
72
|
+
// Runtime State
|
|
73
|
+
public float progress = 0f; // Hold tile progress (0-1)
|
|
74
|
+
public float accuracy = -1; // Touch accuracy score
|
|
75
|
+
public TileStatus Status { get; set; } // None, Touching, End, Missed
|
|
76
|
+
|
|
77
|
+
// Visual Integration
|
|
78
|
+
public RhythmTile view { get; private set; } // Attached tile visual
|
|
79
|
+
public Transform viewTrans { get; private set; } // Transform cache
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Key Features:**
|
|
84
|
+
- **Immutable Core**: `index`, `note`, and `context` are readonly for data integrity
|
|
85
|
+
- **Status Management**: Automatic listener notification on status changes
|
|
86
|
+
- **View Lifecycle**: Handles attachment/detachment of visual components
|
|
87
|
+
- **Progress Tracking**: Real-time progress calculation using `context.GetDistanceAtTime()`
|
|
88
|
+
|
|
89
|
+
**Status Flow:**
|
|
90
|
+
```
|
|
91
|
+
None → Touching → End
|
|
92
|
+
↓ ↓ ↓
|
|
93
|
+
Missed ← → (status change triggers RefreshTileStatus())
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### MT3Tile2 - Modular Base Implementation
|
|
97
|
+
|
|
98
|
+
**Partial Class Architecture:**
|
|
99
|
+
```csharp
|
|
100
|
+
// Size Management Partial
|
|
101
|
+
partial class MT3Tile2
|
|
102
|
+
{
|
|
103
|
+
public Widget2D widget;
|
|
104
|
+
protected virtual void RefreshTileSize()
|
|
105
|
+
{
|
|
106
|
+
if (tileContext == null || widget == null) return;
|
|
107
|
+
var screen = context.game.GetComponent<Screen2D>();
|
|
108
|
+
widget.width = 1f / context.nLanes * screen.width;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Touch Handling Partial
|
|
113
|
+
partial class MT3Tile2: IPointerDownHandler, IPointerMoveHandler, IPointerUpHandler
|
|
114
|
+
{
|
|
115
|
+
public void OnPointerDown(PointerEventData eventData) { /* Touch logic */ }
|
|
116
|
+
public void OnPointerMove(PointerEventData eventData) { /* Move tracking */ }
|
|
117
|
+
public void OnPointerUp(PointerEventData eventData) { /* Release handling */ }
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Core Rhythm Behavior
|
|
121
|
+
public partial class MT3Tile2 : RhythmBehaviour
|
|
122
|
+
{
|
|
123
|
+
public virtual void OnAttach(TileContext tile)
|
|
124
|
+
{
|
|
125
|
+
AttachTileData(); // Calculate size and position
|
|
126
|
+
RefreshTileStatus(); // Update visual state
|
|
127
|
+
RefreshTileSize(); // Apply screen adaptation
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Screen Adaptation Flow
|
|
133
|
+
|
|
134
|
+
**1. Screen2D Detection:**
|
|
135
|
+
```csharp
|
|
136
|
+
// Screen2D automatically detects screen changes
|
|
137
|
+
private void Update()
|
|
138
|
+
{
|
|
139
|
+
var currentSize = GetCurrentScreenSize();
|
|
140
|
+
if (Vector2.Distance(currentSize, _lastScreenSize) > 1f)
|
|
141
|
+
{
|
|
142
|
+
_lastScreenSize = currentSize;
|
|
143
|
+
UpdateScreenSize(); // Triggers cascade update
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**2. Tile Width Calculation:**
|
|
149
|
+
```csharp
|
|
150
|
+
// MT3Tile2 receives screen-relative width
|
|
151
|
+
protected virtual void RefreshTileSize()
|
|
152
|
+
{
|
|
153
|
+
var screen = context.game.GetComponent<Screen2D>();
|
|
154
|
+
widget.width = 1f / context.nLanes * screen.width; // Equal lane distribution
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**3. Automatic Component Updates:**
|
|
159
|
+
```csharp
|
|
160
|
+
// Widget2D automatically applies to all target components
|
|
161
|
+
public void Refresh()
|
|
162
|
+
{
|
|
163
|
+
ApplySizeToComponents(); // Updates SpriteRenderer, Colliders, etc.
|
|
164
|
+
NotifyListeners(); // Triggers ISizeListener callbacks
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## 🔧 TileAnchor System - Smart Positioning
|
|
169
|
+
|
|
170
|
+
### Real-World Example from TileLong
|
|
171
|
+
|
|
172
|
+
`TileAnchor` provides dynamic positioning for tile elements based on calculated tile dimensions:
|
|
173
|
+
|
|
174
|
+
```csharp
|
|
175
|
+
public class TileAnchor : MonoBehaviour
|
|
176
|
+
{
|
|
177
|
+
[SerializeField] internal MT3Tile2 tile;
|
|
178
|
+
[SerializeField] [Range(0f, 1f)] private float slideMultiplier; // Position along slide length
|
|
179
|
+
[SerializeField] [Range(-1f, 1f)] private float shortMultiplier; // Offset from short tile height
|
|
180
|
+
|
|
181
|
+
public void Refresh()
|
|
182
|
+
{
|
|
183
|
+
if (tile == null) return;
|
|
184
|
+
var tileData = tile.tileData;
|
|
185
|
+
if (tileData == null) return;
|
|
186
|
+
|
|
187
|
+
var slideLength = tileData.slideLength; // Calculated slide distance
|
|
188
|
+
var shortLength = tile.config.shortTileHeight; // Base tile height
|
|
189
|
+
var length = shortLength * shortMultiplier + slideLength * slideMultiplier;
|
|
190
|
+
transform.localPosition = new Vector3(0, length, 0);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### TileLong Integration Example
|
|
196
|
+
|
|
197
|
+
In the `TileLong` prefab hierarchy:
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
Tile-Long (Root)
|
|
201
|
+
├── Widget2D (Screen adaptation)
|
|
202
|
+
├── TileLong (Behavior script)
|
|
203
|
+
├── Bottom (Container)
|
|
204
|
+
│ ├── bg (SpriteRenderer - Background)
|
|
205
|
+
│ ├── fill (SpriteRenderer - Progress fill)
|
|
206
|
+
│ └── miss (SpriteRenderer - Miss state)
|
|
207
|
+
├── arrow (SwipeArrow with TileAnchor)
|
|
208
|
+
│ └── TileAnchor: slideMultiplier = 1.0, shortMultiplier = 0.0
|
|
209
|
+
├── Index (Debug text with TileAnchor)
|
|
210
|
+
│ └── TileAnchor: slideMultiplier = 1.0, shortMultiplier = 0.65
|
|
211
|
+
└── Info (Additional UI with TileAnchor)
|
|
212
|
+
└── TileAnchor: slideMultiplier = 0.0, shortMultiplier = -0.5
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**Usage Patterns:**
|
|
216
|
+
|
|
217
|
+
1. **Arrow Positioning** (`slideMultiplier = 1.0`):
|
|
218
|
+
- Positions at the end of the slide area
|
|
219
|
+
- Perfect for swipe direction indicators
|
|
220
|
+
- Auto-adjusts when tile length changes
|
|
221
|
+
|
|
222
|
+
2. **Debug Text** (`slideMultiplier = 1.0, shortMultiplier = 0.65`):
|
|
223
|
+
- Positions at slide end + 65% of short tile height
|
|
224
|
+
- Provides consistent spacing above the tile
|
|
225
|
+
- Useful for tile index display
|
|
226
|
+
|
|
227
|
+
3. **Info Elements** (`slideMultiplier = 0.0, shortMultiplier = -0.5`):
|
|
228
|
+
- Positions at slide start - 50% of short tile height
|
|
229
|
+
- Creates space below the tile
|
|
230
|
+
- Good for additional UI elements
|
|
231
|
+
|
|
232
|
+
### TileLong OnAttach Integration
|
|
233
|
+
|
|
234
|
+
```csharp
|
|
235
|
+
public override void OnAttach(TileContext tile)
|
|
236
|
+
{
|
|
237
|
+
base.OnAttach(tile);
|
|
238
|
+
|
|
239
|
+
// Set Widget2D height to calculated total length
|
|
240
|
+
widget.height = tileData.totalLength;
|
|
241
|
+
|
|
242
|
+
// Refresh all anchors with new tile data
|
|
243
|
+
for (var i = 0; i < anchors.Count; i++)
|
|
244
|
+
{
|
|
245
|
+
anchors[i].tile = this; // Provide tile reference
|
|
246
|
+
anchors[i].Refresh(); // Calculate new positions
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
## 🎮 Handler System Details
|
|
252
|
+
|
|
253
|
+
### SizeHandler (Proportional Sizing)
|
|
254
|
+
```csharp
|
|
255
|
+
[Serializable] public class SizeHandler
|
|
256
|
+
{
|
|
257
|
+
public AxisFilter axis = AxisFilter.None;
|
|
258
|
+
[Range(0f, 2f)] public float percentX = 1f;
|
|
259
|
+
[Range(0f, 2f)] public float percentY = 1f;
|
|
260
|
+
public bool keepRatio = false;
|
|
261
|
+
public Vector2 delta = Vector2.zero;
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
**Features:**
|
|
265
|
+
- **Percentage-based sizing** - Relative to source widget dimensions
|
|
266
|
+
- **Ratio preservation** - Maintains aspect ratio when enabled
|
|
267
|
+
- **Delta adjustments** - Fixed pixel offsets for fine-tuning
|
|
268
|
+
- **Axis filtering** - Apply to X, Y, or both axes independently
|
|
269
|
+
|
|
270
|
+
**Calculation Logic:**
|
|
271
|
+
```csharp
|
|
272
|
+
var newSize = inputSize;
|
|
273
|
+
if (axis.HasFlag(AxisFilter.X)) newSize.x = inputSize.x * percentX + delta.x;
|
|
274
|
+
if (axis.HasFlag(AxisFilter.Y)) newSize.y = inputSize.y * percentY + delta.y;
|
|
275
|
+
|
|
276
|
+
if (keepRatio && axis == AxisFilter.Both)
|
|
277
|
+
{
|
|
278
|
+
var ratio = Mathf.Min(newSize.x / originalSize.x, newSize.y / originalSize.y);
|
|
279
|
+
newSize = originalSize * ratio;
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### ScaleHandler (Transform Scaling)
|
|
284
|
+
```csharp
|
|
285
|
+
[Serializable] public class ScaleHandler
|
|
286
|
+
{
|
|
287
|
+
public AxisFilter axis = AxisFilter.None;
|
|
288
|
+
[Range(0f, 5f)] public float scaleX = 1f;
|
|
289
|
+
[Range(0f, 5f)] public float scaleY = 1f;
|
|
290
|
+
[Range(0f, 1f)] public float fitParameter = 0f;
|
|
291
|
+
}
|
|
292
|
+
```
|
|
293
|
+
**Features:**
|
|
294
|
+
- **Independent scaling** - Separate X/Y axis control
|
|
295
|
+
- **Ratio preservation** - Uniform scaling with fit/fill blend
|
|
296
|
+
- `fitParameter` (0-1) - Fit (show all) to Fill (cover all) interpolation
|
|
297
|
+
|
|
298
|
+
**Fit/Fill Logic:**
|
|
299
|
+
```csharp
|
|
300
|
+
var fitScale = Mathf.Min(scaledRatioX, scaledRatioY); // Fit: shows all content
|
|
301
|
+
var fillScale = Mathf.Max(scaledRatioX, scaledRatioY); // Fill: fills entire area
|
|
302
|
+
var finalScale = Mathf.Lerp(fitScale, fillScale, fitParameter);
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### AlignHandler (Position Control)
|
|
306
|
+
```csharp
|
|
307
|
+
[Serializable] public class AlignHandler
|
|
308
|
+
{
|
|
309
|
+
public AxisFilter axis = AxisFilter.None;
|
|
310
|
+
[Range(-1f, 2f)] public float alignX = 0.5f;
|
|
311
|
+
[Range(-1f, 2f)] public float alignY = 0.5f;
|
|
312
|
+
public Vector2 offset = Vector2.zero;
|
|
313
|
+
public Vector2 selfAlign = Vector2.zero;
|
|
314
|
+
}
|
|
315
|
+
```
|
|
316
|
+
**Features:**
|
|
317
|
+
- `alignX/Y` (-1 to 2) - **Extended range** for positioning beyond source bounds
|
|
318
|
+
- `0.0` = Left/Bottom edge
|
|
319
|
+
- `0.5` = Center (default)
|
|
320
|
+
- `1.0` = Right/Top edge
|
|
321
|
+
- `< 0` = Outside left/bottom
|
|
322
|
+
- `> 1` = Outside right/top
|
|
323
|
+
- `offset` - Fixed world-space position adjustment
|
|
324
|
+
- `selfAlign` - Self-centering offset based on own size
|
|
325
|
+
- **Pivot-aware positioning** - Respects source widget pivot settings
|
|
326
|
+
|
|
327
|
+
**Position Calculation:**
|
|
328
|
+
```csharp
|
|
329
|
+
var inputOffset = inputWidget.size;
|
|
330
|
+
inputOffset.Scale(inputWidget.pivot); // NEW: Pivot consideration
|
|
331
|
+
|
|
332
|
+
var alignOffsetX = inputSize.x * (alignX - 0.5f);
|
|
333
|
+
var selfAlignOffsetX = outputSize.x * selfAlign.x * 0.5f;
|
|
334
|
+
newPos.x = inputPos.x + alignOffsetX + offset.x + selfAlignOffsetX;
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
## 🎵 Real-World Usage Examples
|
|
338
|
+
|
|
339
|
+
### Screen Adaptation (MT3Game)
|
|
340
|
+
```csharp
|
|
341
|
+
// Main screen with 10.8x19.2 design size
|
|
342
|
+
Screen2D screen = GetComponent<Screen2D>();
|
|
343
|
+
screen.fitWidthToHeight = 1f; // Full height fitting
|
|
344
|
+
// Automatically adapts to device screen ratios
|
|
345
|
+
```
|
|
346
|
+
**Use Case:** Main game area that scales consistently across iPhone/iPad/Android devices
|
|
347
|
+
|
|
348
|
+
### Perfect Area Positioning
|
|
349
|
+
```csharp
|
|
350
|
+
// PerfectArea: 10.8x4.8 widget positioned at 25% screen height
|
|
351
|
+
WidgetTransform perfectArea;
|
|
352
|
+
perfectArea.source = gameScreen; // Reference to main screen
|
|
353
|
+
perfectArea.scale.axis = AxisFilter.Y;
|
|
354
|
+
perfectArea.scale.scaleY = 0.25f; // 25% of screen height
|
|
355
|
+
perfectArea.align.axis = AxisFilter.Y;
|
|
356
|
+
perfectArea.align.alignY = 0.25f; // Position at 25% from bottom
|
|
357
|
+
```
|
|
358
|
+
**Use Case:** Hit detection area that maintains consistent size relative to screen
|
|
359
|
+
|
|
360
|
+
### Responsive UI Elements
|
|
361
|
+
```csharp
|
|
362
|
+
// Tile-Start: 2.7x4.8 with ratio-preserved scaling
|
|
363
|
+
WidgetTransform tileStart;
|
|
364
|
+
tileStart.source = gameScreen;
|
|
365
|
+
tileStart.size.keepRatio = true; // Preserve aspect ratio
|
|
366
|
+
tileStart.size.percentX = 0.25f; // 25% of screen width
|
|
367
|
+
```
|
|
368
|
+
**Use Case:** UI elements that scale proportionally while maintaining visual consistency
|
|
369
|
+
|
|
370
|
+
### Dynamic Tile Sizing
|
|
371
|
+
```csharp
|
|
372
|
+
// TileLong: Dynamic height based on note duration
|
|
373
|
+
public override void OnAttach(TileContext tile)
|
|
374
|
+
{
|
|
375
|
+
base.OnAttach(tile);
|
|
376
|
+
widget.height = tileData.totalLength; // Calculated from note duration
|
|
377
|
+
|
|
378
|
+
// Update all anchor positions
|
|
379
|
+
for (var i = 0; i < anchors.Count; i++)
|
|
380
|
+
{
|
|
381
|
+
anchors[i].tile = this;
|
|
382
|
+
anchors[i].Refresh();
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
```
|
|
386
|
+
**Use Case:** Hold tiles that adapt length based on musical note duration
|
|
387
|
+
|
|
388
|
+
## 🚀 Implementation Best Practices
|
|
389
|
+
|
|
390
|
+
### 1. Component Setup
|
|
391
|
+
```csharp
|
|
392
|
+
// Add Widget2D to any GameObject requiring responsive sizing
|
|
393
|
+
var widget = gameObject.AddComponent<Widget2D>();
|
|
394
|
+
|
|
395
|
+
// Screen2D for main game areas
|
|
396
|
+
var screen = gameObject.AddComponent<Screen2D>();
|
|
397
|
+
screen.fitWidthToHeight = 1f; // Adjust based on design requirements
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
### 2. Hierarchical Layouts
|
|
401
|
+
```csharp
|
|
402
|
+
// Parent-child responsive relationships
|
|
403
|
+
var parentWidget = parent.GetComponent<Widget2D>();
|
|
404
|
+
var childTransform = child.AddComponent<WidgetTransform>();
|
|
405
|
+
childTransform.source = parentWidget;
|
|
406
|
+
childTransform.size.percentX = 0.5f; // 50% of parent width
|
|
407
|
+
childTransform.align.alignX = 0.5f; // Center horizontally
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
### 3. Custom Component Support
|
|
411
|
+
```csharp
|
|
412
|
+
// Extend WidgetHandler for new component types
|
|
413
|
+
WidgetHandler.RegisterHandler<YourCustomComponent>(
|
|
414
|
+
(component, size) => {
|
|
415
|
+
// Apply size to your custom component
|
|
416
|
+
component.customWidth = size.x;
|
|
417
|
+
component.customHeight = size.y;
|
|
418
|
+
component.RefreshLayout();
|
|
419
|
+
}
|
|
420
|
+
);
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
### 4. Editor Integration
|
|
424
|
+
```csharp
|
|
425
|
+
#if UNITY_EDITOR
|
|
426
|
+
private void OnValidate()
|
|
427
|
+
{
|
|
428
|
+
// Auto-refresh in editor for immediate feedback
|
|
429
|
+
EditorApplication.delayCall += Refresh;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
private void OnDrawGizmosSelected()
|
|
433
|
+
{
|
|
434
|
+
// Visual debugging in scene view
|
|
435
|
+
if (widget != null) widget.DrawGizmosSelected();
|
|
436
|
+
}
|
|
437
|
+
#endif
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
## 🎯 Key Benefits
|
|
441
|
+
|
|
442
|
+
1. **Zero Boilerplate**: Tiles adapt to screen size without manual calculations
|
|
443
|
+
2. **Consistent Scaling**: All components scale together via single Widget2D
|
|
444
|
+
3. **Designer Friendly**: Visual setup in prefabs, minimal code changes
|
|
445
|
+
4. **Runtime Adaptive**: Handles device rotation and screen changes automatically
|
|
446
|
+
5. **Extensible**: Easy to add new tile types or components
|
|
447
|
+
6. **Data-Driven**: TileContext bridges game logic with visual representation
|
|
448
|
+
7. **Modular Architecture**: Partial classes separate concerns cleanly
|
|
449
|
+
|
|
450
|
+
This architecture demonstrates excellent separation of concerns, where **data drives behavior**, **Widget2D handles presentation**, and **minimal inheritance provides maximum reusability**. The system achieves complex screen adaptation through declarative configuration rather than imperative code.
|
package/Docs.meta
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
using UnityEngine;
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
|
|
4
|
+
namespace Amanotes.MagicTilesCore
|
|
5
|
+
{
|
|
6
|
+
[CustomEditor(typeof(AdjustHue))]
|
|
7
|
+
public class AdjustHueEditor : Editor
|
|
8
|
+
{
|
|
9
|
+
private AdjustHue adjustHue;
|
|
10
|
+
|
|
11
|
+
private void OnEnable()
|
|
12
|
+
{
|
|
13
|
+
adjustHue = (AdjustHue)target;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public override void OnInspectorGUI()
|
|
17
|
+
{
|
|
18
|
+
serializedObject.Update();
|
|
19
|
+
|
|
20
|
+
// Draw default inspector
|
|
21
|
+
DrawDefaultInspector();
|
|
22
|
+
|
|
23
|
+
EditorGUILayout.Space();
|
|
24
|
+
|
|
25
|
+
// Draw preset color rectangles
|
|
26
|
+
EditorGUILayout.LabelField("Quick Hue Presets (Click to Apply)", EditorStyles.boldLabel);
|
|
27
|
+
|
|
28
|
+
var presets = adjustHue.GetPresets();
|
|
29
|
+
const float colorRectSize = 30f;
|
|
30
|
+
const float spacing = 5f;
|
|
31
|
+
|
|
32
|
+
EditorGUILayout.BeginHorizontal();
|
|
33
|
+
|
|
34
|
+
for (int i = 0; i < presets.Length; i++)
|
|
35
|
+
{
|
|
36
|
+
var presetHue = presets[i];
|
|
37
|
+
// Convert hue (0-255) to HSV with S=100%, V=100%
|
|
38
|
+
float hue01 = presetHue / 255f;
|
|
39
|
+
var presetColor = Color.HSVToRGB(hue01, 1f, 1f);
|
|
40
|
+
|
|
41
|
+
// Create a rect for the color button
|
|
42
|
+
var rect = GUILayoutUtility.GetRect(colorRectSize, colorRectSize, GUILayout.Width(colorRectSize), GUILayout.Height(colorRectSize));
|
|
43
|
+
|
|
44
|
+
// Draw the color rectangle
|
|
45
|
+
EditorGUI.DrawRect(rect, presetColor);
|
|
46
|
+
|
|
47
|
+
// Handle click
|
|
48
|
+
if (Event.current.type == EventType.MouseDown && rect.Contains(Event.current.mousePosition))
|
|
49
|
+
{
|
|
50
|
+
adjustHue.SetHue(presetHue);
|
|
51
|
+
EditorUtility.SetDirty(adjustHue);
|
|
52
|
+
Event.current.Use();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Add spacing between rectangles
|
|
56
|
+
if (i < presets.Length - 1)
|
|
57
|
+
{
|
|
58
|
+
GUILayout.Space(spacing);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
EditorGUILayout.EndHorizontal();
|
|
63
|
+
|
|
64
|
+
// Show hue values under the rectangles
|
|
65
|
+
EditorGUILayout.BeginHorizontal();
|
|
66
|
+
for (int i = 0; i < presets.Length; i++)
|
|
67
|
+
{
|
|
68
|
+
var labelRect = GUILayoutUtility.GetRect(colorRectSize, 16f, GUILayout.Width(colorRectSize));
|
|
69
|
+
EditorGUI.LabelField(labelRect, presets[i].ToString(), EditorStyles.centeredGreyMiniLabel);
|
|
70
|
+
|
|
71
|
+
if (i < presets.Length - 1)
|
|
72
|
+
{
|
|
73
|
+
GUILayout.Space(spacing);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
EditorGUILayout.EndHorizontal();
|
|
77
|
+
|
|
78
|
+
EditorGUILayout.Space();
|
|
79
|
+
|
|
80
|
+
// Refresh button
|
|
81
|
+
if (GUILayout.Button("Refresh Component List"))
|
|
82
|
+
{
|
|
83
|
+
adjustHue.RefreshComponentList();
|
|
84
|
+
EditorUtility.SetDirty(adjustHue);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
serializedObject.ApplyModifiedProperties();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|