@@ -66,7 +66,7 @@ namespace Ichni.RhythmGame
|
||||
InspectorBuilder.For(this)
|
||||
.Section("Note Info")
|
||||
.InputField(nameof(exactJudgeTime), "exactJudgeTime")
|
||||
.OnChanged(() => UpdateNoteInTrack(CoreServices.TimeProvider.SongTime))
|
||||
.OnChanged(HandleExactJudgeTimeChanged)
|
||||
.Mark("ExactJudgeTime")
|
||||
.Button("Save Note Prefab", () =>
|
||||
{
|
||||
@@ -81,6 +81,14 @@ namespace Ichni.RhythmGame
|
||||
.EnabledIf(() => noteVisual == null)
|
||||
.Build();
|
||||
}
|
||||
|
||||
private void HandleExactJudgeTimeChanged()
|
||||
{
|
||||
float songTime = CoreServices.TimeProvider?.SongTime ?? EditorManager.instance.songInformation.songTime;
|
||||
UpdateNoteInTrack(songTime);
|
||||
Refresh();
|
||||
CoreServices.UpdateScheduler?.NoteScheduler.ManualTick(songTime);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,10 +99,14 @@ namespace Ichni.RhythmGame
|
||||
CommandManager.ExecuteCreate(() => TrackHeadPoint.GenerateElement("New Track Head Point", Guid.NewGuid(), new List<string>(), true, this, false, Vector3.zero));
|
||||
})
|
||||
.EnabledIf(() => trackTimeSubmodule is TrackTimeSubmoduleMovable)
|
||||
.Button("Tap", () => CommandManager.ExecuteCreate(() => Tap.GenerateElement("New Tap", Guid.NewGuid(), new List<string>(), true, this, 0f)))
|
||||
.Button("Stay", () => CommandManager.ExecuteCreate(() => Stay.GenerateElement("New Stay", Guid.NewGuid(), new List<string>(), true, this, 0f)))
|
||||
.Button("Hold", () => CommandManager.ExecuteCreate(() => Hold.GenerateElement("New Hold", Guid.NewGuid(), new List<string>(), true, this, 0f, 1f)))
|
||||
.Button("Flick", () => CommandManager.ExecuteCreate(() => Flick.GenerateElement("New Flick", Guid.NewGuid(), new List<string>(), true, this, 0f, new List<Vector2>())))
|
||||
.Button("Tap", () => CommandManager.ExecuteCreate(() => PrepareGeneratedNote(Tap.GenerateElement("New Tap", Guid.NewGuid(), new List<string>(), true, this, GetDefaultNoteGenerateTime()))))
|
||||
.Button("Stay", () => CommandManager.ExecuteCreate(() => PrepareGeneratedNote(Stay.GenerateElement("New Stay", Guid.NewGuid(), new List<string>(), true, this, GetDefaultNoteGenerateTime()))))
|
||||
.Button("Hold", () => CommandManager.ExecuteCreate(() =>
|
||||
{
|
||||
float startTime = GetDefaultNoteGenerateTime();
|
||||
return PrepareGeneratedNote(Hold.GenerateElement("New Hold", Guid.NewGuid(), new List<string>(), true, this, startTime, startTime + 1f));
|
||||
}))
|
||||
.Button("Flick", () => CommandManager.ExecuteCreate(() => PrepareGeneratedNote(Flick.GenerateElement("New Flick", Guid.NewGuid(), new List<string>(), true, this, GetDefaultNoteGenerateTime(), new List<Vector2>()))))
|
||||
.Button("Particle Tracker", () =>
|
||||
{
|
||||
CommandManager.ExecuteCreate(() => ParticleTracker.GenerateElement("New Particle Tracker", Guid.NewGuid(), new List<string>(), true, this,
|
||||
@@ -233,6 +237,17 @@ namespace Ichni.RhythmGame
|
||||
#endregion
|
||||
|
||||
#region [工具方法] Tool Methods
|
||||
private static float GetDefaultNoteGenerateTime()
|
||||
{
|
||||
return CoreServices.TimeProvider?.SongTime ?? EditorManager.instance.songInformation.songTime;
|
||||
}
|
||||
|
||||
private static T PrepareGeneratedNote<T>(T note) where T : NoteBase
|
||||
{
|
||||
note.noteVisual?.transformSubmodule?.Refresh();
|
||||
return note;
|
||||
}
|
||||
|
||||
[Button("Test GetAllNotes")]
|
||||
public List<NoteBase> GetAllNotes()
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Ichni.RhythmGame
|
||||
public GameCamera gameCamera;
|
||||
public SceneCamera sceneCamera => EditorManager.instance.cameraManager.sceneCamera;
|
||||
|
||||
public float farClipRange = 1000f;
|
||||
public float farClipRange = 2000f;
|
||||
#endregion
|
||||
|
||||
#region [生命周期] Lifecycle & Factory
|
||||
|
||||
Reference in New Issue
Block a user