同步
This commit is contained in:
@@ -30,9 +30,9 @@ namespace Ichni.RhythmGame
|
||||
// 【新增】受管家管控
|
||||
GameManager.Instance.animationManager.RegisterAnimation(this);
|
||||
float delay = GameManager.Instance.songInformation.delay;
|
||||
if (timeDurationSubmodule.CheckTimeInDuration(delay))
|
||||
if (timeDurationSubmodule.CheckTimeInDuration(-delay))
|
||||
{
|
||||
UpdateAnimation(0f); // 确保与最新的 SongTime 同步
|
||||
ManualUpdate(-delay, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,13 +40,13 @@ namespace Ichni.RhythmGame
|
||||
/// 更新动画
|
||||
/// </summary>
|
||||
/// <param name="songTime">歌曲时间</param>
|
||||
protected abstract void UpdateAnimation(float songTime);
|
||||
protected abstract void UpdateAnimation(float songTime, bool forceUpdate);
|
||||
|
||||
public virtual void ManualUpdate(float currentSongTime)
|
||||
public virtual void ManualUpdate(float currentSongTime, bool forceUpdate = false)
|
||||
{
|
||||
if (timeDurationSubmodule.CheckTimeInDuration(currentSongTime))
|
||||
{
|
||||
UpdateAnimation(currentSongTime);
|
||||
UpdateAnimation(currentSongTime, forceUpdate);
|
||||
}
|
||||
|
||||
if (timeDurationSubmodule.CheckAfterEndTime(currentSongTime))
|
||||
|
||||
@@ -37,11 +37,11 @@ namespace Ichni.RhythmGame
|
||||
#endregion
|
||||
|
||||
#region [核心动画逻辑] Core Animation Logic
|
||||
protected override void UpdateAnimation(float songTime)
|
||||
protected override void UpdateAnimation(float songTime, bool forceUpdate)
|
||||
{
|
||||
fieldOfView.UpdateFlexibleFloat(songTime);
|
||||
|
||||
if (fieldOfView.returnType == FlexibleReturnType.MiddleExecuting)
|
||||
if (forceUpdate || fieldOfView.returnType == FlexibleReturnType.MiddleExecuting)
|
||||
{
|
||||
targetGameCamera.perspectiveAngle = fieldOfView.value;
|
||||
targetGameCamera.cam.fieldOfView = fieldOfView.value;
|
||||
|
||||
@@ -45,19 +45,19 @@ namespace Ichni.RhythmGame
|
||||
#endregion
|
||||
|
||||
#region [核心动画逻辑] Core Animation Logic
|
||||
protected override void UpdateAnimation(float songTime)
|
||||
protected override void UpdateAnimation(float songTime, bool forceUpdate)
|
||||
{
|
||||
colorR.UpdateFlexibleFloat(songTime);
|
||||
colorG.UpdateFlexibleFloat(songTime);
|
||||
colorB.UpdateFlexibleFloat(songTime);
|
||||
colorA.UpdateFlexibleFloat(songTime);
|
||||
|
||||
if ((colorR.returnType is FlexibleReturnType.MiddleExecuting || colorR.isSwitchingReturnType) ||
|
||||
if (forceUpdate || (colorR.returnType is FlexibleReturnType.MiddleExecuting || colorR.isSwitchingReturnType) ||
|
||||
(colorG.returnType is FlexibleReturnType.MiddleExecuting || colorG.isSwitchingReturnType) ||
|
||||
(colorB.returnType is FlexibleReturnType.MiddleExecuting || colorB.isSwitchingReturnType) ||
|
||||
(colorA.returnType is FlexibleReturnType.MiddleExecuting || colorA.isSwitchingReturnType))
|
||||
{
|
||||
animationReturnType = FlexibleReturnType.MiddleExecuting;
|
||||
if(!forceUpdate) animationReturnType = FlexibleReturnType.MiddleExecuting;
|
||||
|
||||
targetColorSubmodule.currentBaseColor = new Color(colorR.value, colorG.value, colorB.value, colorA.value);
|
||||
targetColorSubmodule.baseColorDirtyMark = true;
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Ichni.RhythmGame
|
||||
#endregion
|
||||
|
||||
#region [核心动画逻辑] Core Animation Logic
|
||||
protected override void UpdateAnimation(float songTime)
|
||||
protected override void UpdateAnimation(float songTime, bool forceUpdate)
|
||||
{
|
||||
colorR.UpdateFlexibleFloat(songTime);
|
||||
colorG.UpdateFlexibleFloat(songTime);
|
||||
@@ -56,7 +56,7 @@ namespace Ichni.RhythmGame
|
||||
(colorB.returnType is FlexibleReturnType.MiddleExecuting || colorB.isSwitchingReturnType) ||
|
||||
(colorI.returnType is FlexibleReturnType.MiddleExecuting || colorI.isSwitchingReturnType))
|
||||
{
|
||||
animationReturnType = FlexibleReturnType.MiddleExecuting;
|
||||
if(!forceUpdate) animationReturnType = FlexibleReturnType.MiddleExecuting;
|
||||
|
||||
targetColorSubmodule.currentEmissionColor = new Color(colorR.value, colorG.value, colorB.value, 1);
|
||||
targetColorSubmodule.currentEmissionIntensity = colorI.value;
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace Ichni.RhythmGame
|
||||
#endregion
|
||||
|
||||
#region [核心动画逻辑] Core Animation Logic
|
||||
protected override void UpdateAnimation(float songTime)
|
||||
protected override void UpdateAnimation(float songTime, bool forceUpdate)
|
||||
{
|
||||
if (targetComponent == null) return;
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace Ichni.RhythmGame
|
||||
#endregion
|
||||
|
||||
#region [核心动画逻辑] Core Animation Logic
|
||||
protected override void UpdateAnimation(float songTime)
|
||||
protected override void UpdateAnimation(float songTime, bool forceUpdate)
|
||||
{
|
||||
if (targetComponent == null || propertyValue == null || propertyValue.animations.Count == 0) return;
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace Ichni.RhythmGame
|
||||
#endregion
|
||||
|
||||
#region [核心动画逻辑] Core Animation Logic
|
||||
protected override void UpdateAnimation(float songTime)
|
||||
protected override void UpdateAnimation(float songTime, bool forceUpdate)
|
||||
{
|
||||
if (targetComponent == null) return;
|
||||
|
||||
|
||||
@@ -44,19 +44,19 @@ namespace Ichni.RhythmGame
|
||||
#endregion
|
||||
|
||||
#region [核心动画逻辑] Core Animation Logic
|
||||
protected override void UpdateAnimation(float songTime)
|
||||
protected override void UpdateAnimation(float songTime, bool forceUpdate)
|
||||
{
|
||||
colorR.UpdateFlexibleFloat(songTime);
|
||||
colorG.UpdateFlexibleFloat(songTime);
|
||||
colorB.UpdateFlexibleFloat(songTime);
|
||||
colorA.UpdateFlexibleFloat(songTime);
|
||||
|
||||
if ((colorR.returnType is FlexibleReturnType.MiddleExecuting || colorR.isSwitchingReturnType) ||
|
||||
if (forceUpdate || (colorR.returnType is FlexibleReturnType.MiddleExecuting || colorR.isSwitchingReturnType) ||
|
||||
(colorG.returnType is FlexibleReturnType.MiddleExecuting || colorG.isSwitchingReturnType) ||
|
||||
(colorB.returnType is FlexibleReturnType.MiddleExecuting || colorB.isSwitchingReturnType) ||
|
||||
(colorA.returnType is FlexibleReturnType.MiddleExecuting || colorA.isSwitchingReturnType))
|
||||
{
|
||||
animationReturnType = FlexibleReturnType.MiddleExecuting;
|
||||
if(!forceUpdate) animationReturnType = FlexibleReturnType.MiddleExecuting;
|
||||
Color color = new Color(colorR.value, colorG.value, colorB.value, colorA.value);
|
||||
((Track)animatedObject).trackRendererSubmodule.meshGenerator.color = color;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateAnimation(CoreServices.TimeProvider.SongTime);
|
||||
UpdateAnimation(CoreServices.TimeProvider.SongTime, false);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Ichni.RhythmGame
|
||||
#endregion
|
||||
|
||||
#region [核心动画逻辑] Core Animation Logic
|
||||
protected override void UpdateAnimation(float songTime)
|
||||
protected override void UpdateAnimation(float songTime, bool forceUpdate)
|
||||
{
|
||||
totalTime.UpdateFlexibleFloat(songTime);
|
||||
|
||||
|
||||
@@ -39,17 +39,17 @@ namespace Ichni.RhythmGame
|
||||
#endregion
|
||||
|
||||
#region [核心动画逻辑] Core Animation Logic
|
||||
protected override void UpdateAnimation(float songTime)
|
||||
protected override void UpdateAnimation(float songTime, bool forceUpdate)
|
||||
{
|
||||
positionX.UpdateFlexibleFloat(songTime);
|
||||
positionY.UpdateFlexibleFloat(songTime);
|
||||
positionZ.UpdateFlexibleFloat(songTime);
|
||||
|
||||
if (positionX.returnType is FlexibleReturnType.MiddleExecuting ||
|
||||
if (forceUpdate || positionX.returnType is FlexibleReturnType.MiddleExecuting ||
|
||||
positionY.returnType is FlexibleReturnType.MiddleExecuting ||
|
||||
positionZ.returnType is FlexibleReturnType.MiddleExecuting)
|
||||
{
|
||||
animationReturnType = FlexibleReturnType.MiddleExecuting;
|
||||
if(!forceUpdate) animationReturnType = FlexibleReturnType.MiddleExecuting;
|
||||
Vector3 currentPosition = new Vector3(positionX.value, positionY.value, positionZ.value);
|
||||
targetTransformSubmodule.positionOffset += currentPosition;
|
||||
targetTransformSubmodule.positionDirtyMark = true;
|
||||
|
||||
@@ -33,9 +33,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
look.targetGameElement = lookAtTarget;
|
||||
look.targetTransformSubmodule = (animatedObject as IHaveTransformSubmodule).transformSubmodule;
|
||||
|
||||
//look.timeDurationSubmodule.SetDuration(-999f, 999f); //TODO: 换为(-delay, songLength)
|
||||
|
||||
return look;
|
||||
}
|
||||
|
||||
@@ -43,6 +41,12 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
}
|
||||
|
||||
public override void AfterInitialize()
|
||||
{
|
||||
base.AfterInitialize();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region [核心动画逻辑] Core Animation Logic
|
||||
@@ -54,7 +58,7 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
}
|
||||
|
||||
protected override void UpdateAnimation(float songTime)
|
||||
protected override void UpdateAnimation(float songTime, bool forceUpdate)
|
||||
{
|
||||
if (targetGameElement is null) return;
|
||||
|
||||
@@ -64,7 +68,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
targetTransformSubmodule.eulerAnglesOffsetLock = enabling.value;
|
||||
}
|
||||
|
||||
|
||||
if (enabling.value)
|
||||
{
|
||||
animationReturnType = FlexibleReturnType.MiddleExecuting;
|
||||
|
||||
@@ -42,17 +42,18 @@ namespace Ichni.RhythmGame
|
||||
#endregion
|
||||
|
||||
#region [核心动画逻辑] Core Animation Logic
|
||||
protected override void UpdateAnimation(float songTime)
|
||||
|
||||
protected override void UpdateAnimation(float songTime, bool forceUpdate)
|
||||
{
|
||||
scaleX.UpdateFlexibleFloat(songTime);
|
||||
scaleY.UpdateFlexibleFloat(songTime);
|
||||
scaleZ.UpdateFlexibleFloat(songTime);
|
||||
|
||||
if (scaleX.returnType is FlexibleReturnType.MiddleExecuting ||
|
||||
if (forceUpdate || scaleX.returnType is FlexibleReturnType.MiddleExecuting ||
|
||||
scaleY.returnType is FlexibleReturnType.MiddleExecuting ||
|
||||
scaleZ.returnType is FlexibleReturnType.MiddleExecuting)
|
||||
{
|
||||
animationReturnType = FlexibleReturnType.MiddleExecuting;
|
||||
if(!forceUpdate) animationReturnType = FlexibleReturnType.MiddleExecuting;
|
||||
Vector3 currentScale = new Vector3(scaleX.value, scaleY.value, scaleZ.value);
|
||||
targetTransformSubmodule.scaleOffset += currentScale;
|
||||
targetTransformSubmodule.scaleDirtyMark = true;
|
||||
|
||||
@@ -37,17 +37,17 @@ namespace Ichni.RhythmGame
|
||||
#endregion
|
||||
|
||||
#region [核心动画逻辑] Core Animation Logic
|
||||
protected override void UpdateAnimation(float songTime)
|
||||
protected override void UpdateAnimation(float songTime, bool forceUpdate)
|
||||
{
|
||||
eulerAngleX.UpdateFlexibleFloat(songTime);
|
||||
eulerAngleY.UpdateFlexibleFloat(songTime);
|
||||
eulerAngleZ.UpdateFlexibleFloat(songTime);
|
||||
|
||||
if (eulerAngleX.returnType is FlexibleReturnType.MiddleExecuting ||
|
||||
if (forceUpdate || eulerAngleX.returnType is FlexibleReturnType.MiddleExecuting ||
|
||||
eulerAngleY.returnType is FlexibleReturnType.MiddleExecuting ||
|
||||
eulerAngleZ.returnType is FlexibleReturnType.MiddleExecuting)
|
||||
{
|
||||
animationReturnType = FlexibleReturnType.MiddleExecuting;
|
||||
if(!forceUpdate) animationReturnType = FlexibleReturnType.MiddleExecuting;
|
||||
Vector3 currentEulerAngles = new Vector3(eulerAngleX.value, eulerAngleY.value, eulerAngleZ.value);
|
||||
targetTransformSubmodule.eulerAnglesOffset += currentEulerAngles;
|
||||
targetTransformSubmodule.eulerAnglesDirtyMark = true;
|
||||
|
||||
Reference in New Issue
Block a user