Merge branch 'main' of https://github.com/MiracleForest-Ichni/IchniCreatorStudio
This commit is contained in:
@@ -32,13 +32,10 @@ namespace Ichni.RhythmGame
|
||||
look.lookAtObject = lookAtTarget;
|
||||
look.enabling = enabling;
|
||||
look.animationReturnType = FlexibleReturnType.Before;
|
||||
|
||||
|
||||
|
||||
look.targetTransformSubmodule = (animatedObject as IHaveTransformSubmodule).transformSubmodule;
|
||||
|
||||
|
||||
//look.timeDurationSubmodule.SetDuration(-999f, 999f); //TODO: 换为(-delay, songLength)
|
||||
|
||||
look.targetTransformSubmodule.lookAt = look;
|
||||
|
||||
return look;
|
||||
}
|
||||
|
||||
@@ -46,43 +43,19 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
}
|
||||
// protected override void Update()
|
||||
// {
|
||||
|
||||
// }
|
||||
// void LateUpdate()
|
||||
// {
|
||||
// if (timeDurationSubmodule.CheckTimeInDuration(EditorManager.instance.songInformation.songTime))
|
||||
// {
|
||||
// UpdateAnimation(EditorManager.instance.songInformation.songTime);
|
||||
// }
|
||||
// }
|
||||
protected override void UpdateAnimation(float songTime)
|
||||
{
|
||||
if (lookAtObject is null) return;
|
||||
|
||||
enabling.UpdateFlexibleBool(songTime);
|
||||
|
||||
targetTransformSubmodule.eulerAnglesOffsetLock = enabling.value;
|
||||
|
||||
if (enabling.value)
|
||||
{
|
||||
animationReturnType = FlexibleReturnType.MiddleExecuting;
|
||||
Vector3 lookingDirection = (lookAtObject.transform.position - animatedObject.transform.position).normalized;
|
||||
|
||||
Vector3 eulerAnglesOffset = Quaternion.LookRotation(lookingDirection).eulerAngles;
|
||||
|
||||
targetTransformSubmodule.eulerAnglesOffset.Add(eulerAnglesOffset);
|
||||
targetTransformSubmodule.eulerAnglesDirtyMark = true;
|
||||
// targetTransformSubmodule.eulerAnglesOffsetLock = true;
|
||||
// targetTransformSubmodule.currentEulerAngles = eulerAnglesOffset;
|
||||
}
|
||||
else if (animationReturnType != FlexibleReturnType.MiddleInterval)
|
||||
{
|
||||
targetTransformSubmodule.eulerAnglesOffset.Add(Vector3.zero);
|
||||
targetTransformSubmodule.eulerAnglesDirtyMark = true;
|
||||
animationReturnType = FlexibleReturnType.MiddleInterval;
|
||||
}
|
||||
|
||||
// targetTransformSubmodule.eulerAnglesOffsetLock = false;
|
||||
|
||||
}
|
||||
|
||||
public override void SaveBM()
|
||||
|
||||
Reference in New Issue
Block a user