This commit is contained in:
SoulliesOfficial
2026-06-05 04:45:57 -04:00
parent 3a63641a2c
commit 7c60c40d6b
377 changed files with 10970 additions and 843 deletions

View File

@@ -6,7 +6,7 @@ using UnityEngine;
namespace Ichni.RhythmGame
{
public partial class SkyboxSubsetter : GameElement
public partial class SkyboxSubsetter : GameElement, IScheduledElement
{
#region [] Core Components & Skybox Lists
public SkyboxBlender skyboxBlender;
@@ -46,6 +46,18 @@ namespace Ichni.RhythmGame
skyboxSubsetter.selectedSkybox = String.Empty;
return skyboxSubsetter;
}
public override void AfterInitialize()
{
base.AfterInitialize();
CoreServices.UpdateScheduler.Register(UpdatePhase.Misc, this);
}
public override void OnDelete()
{
base.OnDelete();
CoreServices.UpdateScheduler.Unregister(UpdatePhase.Misc, this);
}
#endregion
#region [] Internal Configs & Utils
@@ -81,28 +93,31 @@ namespace Ichni.RhythmGame
#endregion
#region [] Main Update
private void Update()
#region [IScheduledElement] Scheduler Interface
public void ScheduledUpdate(UpdatePhase phase, float songTime)
{
if (skyBoxThemeBundleList.Count > 1)
{
float songTime = CoreServices.TimeProvider.SongTime;
float delay = GameManager.Instance.songInformation.delay;
float finalTime = 32767; // 曲目长度
const float finalTime = 32767f; // 曲目长度上限
for (var index = 0; index < blendTimeList.Count + 1; index++)
{
float startTime = index == 0 ? -delay : blendTimeList[index - 1];
float endTime = index >= blendTimeList.Count ? finalTime : blendTimeList[index];
if(songTime >= startTime && songTime < endTime && currentSkyboxIndex != index)
if (songTime >= startTime && songTime < endTime && currentSkyboxIndex != index)
{
currentSkyboxIndex = index;
if(currentSkyboxIndex != 0) skyboxBlender.blendSpeed = blendSpeedList[currentSkyboxIndex - 1];
if (currentSkyboxIndex != 0) skyboxBlender.blendSpeed = blendSpeedList[currentSkyboxIndex - 1];
skyboxBlender.Blend(currentSkyboxIndex, false);
DynamicGI.UpdateEnvironment();
}
}
}
}
public bool IsScheduledActive => isActiveAndEnabled;
#endregion
#endregion
}