Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
@@ -15,7 +15,7 @@ namespace Ichni.RhythmGame
|
||||
/// </summary>
|
||||
public partial class LookAt : AnimationBase
|
||||
{
|
||||
|
||||
public GameCamera gameCamera;
|
||||
public TransformSubmodule targetTransformSubmodule;
|
||||
public GameElement lookAtObject;
|
||||
public FlexibleBool enabling;
|
||||
@@ -32,10 +32,10 @@ namespace Ichni.RhythmGame
|
||||
look.lookAtObject = lookAtTarget;
|
||||
look.enabling = enabling;
|
||||
look.animationReturnType = FlexibleReturnType.Before;
|
||||
|
||||
|
||||
look.targetTransformSubmodule = (animatedObject as IHaveTransformSubmodule).transformSubmodule;
|
||||
look.targetTransformSubmodule.lookAt = look;
|
||||
|
||||
look.gameCamera = EditorManager.instance.cameraManager.gameCamera;
|
||||
return look;
|
||||
}
|
||||
|
||||
@@ -43,18 +43,33 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
}
|
||||
protected override void Update()
|
||||
{
|
||||
|
||||
}
|
||||
void LateUpdate()
|
||||
{
|
||||
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;
|
||||
targetTransformSubmodule.eulerAnglesDirtyMark = true;
|
||||
gameCamera.UpdateLookAt(this);
|
||||
|
||||
}
|
||||
else if (animationReturnType != FlexibleReturnType.MiddleInterval)
|
||||
{
|
||||
animationReturnType = FlexibleReturnType.MiddleInterval;
|
||||
targetTransformSubmodule.eulerAnglesOffset.Add(Vector3.zero);
|
||||
targetTransformSubmodule.eulerAnglesDirtyMark = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user