Signed-off-by: TRAfoer <lhf190@outlook.com>

This commit is contained in:
2025-07-13 20:47:43 +08:00
parent c49d68de9c
commit 81ac6de8dc
11 changed files with 19477 additions and 17474 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 6dbdd314784e80440b48088e6357c1ef
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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;
}
}

View File

@@ -15,7 +15,7 @@ namespace Ichni.RhythmGame
{
public partial class GameCamera : GameElement, IHaveTransformSubmodule, IHaveTimeDurationSubmodule
{
[FormerlySerializedAs("camera")]
[FormerlySerializedAs("camera")]
public Camera gameCamera;
public Transform rotationPoint;
public Transform positionPoint;
@@ -93,18 +93,24 @@ namespace Ichni.RhythmGame
public partial class GameCamera
{
private void LateUpdate() // 处理LookAt
public void UpdateLookAt(LookAt lookAt) // 处理LookAt
{
if (transformSubmodule?.lookAt is not null &&
transformSubmodule.eulerAnglesOffsetLock &&
if (
transformSubmodule.eulerAnglesOffsetLock &&
transformSubmodule.eulerAnglesDirtyMark)
{
Vector3 lookingDirection = (lookAt.lookAtObject.transform.position - transform.position).normalized;
Vector3 eulerAnglesOffse = Quaternion.LookRotation(lookingDirection).eulerAngles;
transformSubmodule.eulerAnglesOffset.Add(eulerAnglesOffse);
Vector3 offset = transformSubmodule.eulerAnglesOffset.Sum();
transformSubmodule.currentEulerAngles = transformSubmodule.originalEulerAngles + offset;
transform.LookAt(transformSubmodule.lookAt.lookAtObject.transform);
transform.localEulerAngles += transformSubmodule.currentEulerAngles;
// transform.LookAt(transformSubmodule.lookAt.lookAtObject.transform);
transform.localEulerAngles = transformSubmodule.currentEulerAngles;
transformSubmodule.eulerAnglesDirtyMark = false;
transformSubmodule.eulerAnglesOffset.Clear();
}
@@ -120,7 +126,7 @@ namespace Ichni.RhythmGame
}
bool willRefresh = false;
if (!transformSubmodule.eulerAnglesOffsetLock && transformSubmodule.eulerAnglesDirtyMark)
{
Vector3 offset = transformSubmodule.eulerAnglesOffset.Sum();
@@ -145,7 +151,7 @@ namespace Ichni.RhythmGame
{
Refresh();
}
}).AddTo(gameObject);
}
}

View File

@@ -38505,7 +38505,7 @@
},{
"__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp",
"MotionAngles" : true,
"elementName" : "143234234243",
"elementName" : "New Track Head Point",
"tags" : [
],
@@ -205737,7 +205737,7 @@
]
},
"lookAtObjectGuid" : {
"value" : "5df21784-b0e4-47c8-8032-9efed6dcfe8d"
"value" : "aa48d6ed-7e95-4417-bad9-c3735309782e"
},
"elementName" : "New Look At",
"tags" : [

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ce3697d0e6db3a44aa65f230b12a9fa6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7f59135bf6881b347b3d735f68a680ca
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
"__type" : "Ichni.RhythmGame.Beatmap.SongInformation_BM,Assembly-CSharp",
"value" : {
"songName" : "Quree vs. Mr. Weq - Leviathan (1).wav",
"bpm" : 120,
"bpm" : 195,
"delay" : 0,
"offset" : 0,
"attachedElementGuid" : {

File diff suppressed because one or more lines are too long