This commit is contained in:
SoulliesOfficial
2025-05-04 03:29:23 -04:00
parent 95e49cb499
commit 58b9d94540
10 changed files with 109 additions and 143 deletions

View File

@@ -62,6 +62,20 @@ namespace Ichni.RhythmGame
{
transformSubmodule = new TransformSubmodule(this);
}
public override void SetUpInspector()
{
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
base.SetUpInspector();
var container = inspector.GenerateContainer("Generate");
var generateAnimation = container.GenerateSubcontainer(3);
var displacementButton = inspector.GenerateButton(this, generateAnimation, "Displacement",
() => Displacement.GenerateElement("New Displacement", Guid.NewGuid(), new List<string>(), true, this,
new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat()));
var swirlButton = inspector.GenerateButton(this, generateAnimation, "Swirl",
() => Swirl.GenerateElement("New Swirl", Guid.NewGuid(), new List<string>(), true, this,
new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat()));
}
}
public partial class GameCamera
@@ -93,11 +107,18 @@ namespace Ichni.RhythmGame
}
public void SetTransformObserver()
{
Observable.EveryUpdate().Subscribe(_ =>
Observable.EveryLateUpdate().Subscribe(_ =>
{
if (transformSubmodule == null)
{
return;
}
bool willRefresh = false;
if (transformSubmodule.eulerAnglesOffsetLock)
{
rotationPoint.localEulerAngles = transformSubmodule.originalEulerAngles;
transform.localEulerAngles = transformSubmodule.originalEulerAngles;
}
else if (transformSubmodule.eulerAnglesDirtyMark)
{
@@ -108,8 +129,9 @@ namespace Ichni.RhythmGame
}
transformSubmodule.currentEulerAngles = transformSubmodule.originalEulerAngles + offset;
rotationPoint.localEulerAngles = transformSubmodule.currentEulerAngles;
transform.localEulerAngles = transformSubmodule.currentEulerAngles;
transformSubmodule.eulerAnglesDirtyMark = false;
willRefresh = true;
}
if (transformSubmodule.positionDirtyMark)
@@ -121,9 +143,19 @@ namespace Ichni.RhythmGame
}
transformSubmodule.currentPosition = transformSubmodule.originalPosition + offset;
positionPoint.localPosition = transformSubmodule.currentPosition;
transform.localPosition = transformSubmodule.currentPosition;
transformSubmodule.positionDirtyMark = false;
willRefresh = true;
}
if(willRefresh)
{
this.Refresh();
}
transformSubmodule.eulerAnglesOffset.Clear();
transformSubmodule.positionOffset.Clear();
}).AddTo(gameObject);
}
}

View File

@@ -5,6 +5,7 @@ using Ichni.Editor;
using Ichni.RhythmGame.Beatmap;
using Lean.Pool;
using Sirenix.OdinInspector;
using UniRx;
using UnityEngine;
namespace Ichni.RhythmGame

View File

@@ -33,7 +33,7 @@ namespace Ichni.RhythmGame
this.isClosed = isClosed;
this.path.sampleRate = 16;
this.path.updateMode = SplineComputer.UpdateMode.LateUpdate;
SetUpSplineComputer(this.trackSpaceType, this.trackSamplingType);
//闭合路径在PathNode生成时执行在初始化的情况下PathNode数量为0不会执行闭合操作

View File

@@ -150,6 +150,7 @@ namespace Ichni.RhythmGame
this.splineRenderer.spline = track.trackPathSubmodule.path;
this.splineRenderer.clipFrom = 0;
this.splineRenderer.clipTo = 1;
this.splineRenderer.updateMethod = SplineUser.UpdateMethod.LateUpdate;
this.meshRenderer.material = renderMaterial;
this.splineRenderer.color = Color.white;
this.splineRenderer.uvRotation = 90;
@@ -226,6 +227,7 @@ namespace Ichni.RhythmGame
this.pathGenerator.spline = track.trackPathSubmodule.path;
this.pathGenerator.clipFrom = 0;
this.pathGenerator.clipTo = 1;
this.pathGenerator.updateMethod = SplineUser.UpdateMethod.LateUpdate;
this.meshRenderer.material = renderMaterial;
this.pathGenerator.color = Color.white;
this.pathGenerator.uvRotation = 90;
@@ -306,6 +308,7 @@ namespace Ichni.RhythmGame
this.tubeGenerator.spline = track.trackPathSubmodule.path;
this.tubeGenerator.clipFrom = 0;
this.tubeGenerator.clipTo = 1;
this.tubeGenerator.updateMethod = SplineUser.UpdateMethod.LateUpdate;
this.meshRenderer.material = renderMaterial;
this.tubeGenerator.color = Color.white;
this.tubeGenerator.uvRotation = 90;
@@ -399,6 +402,7 @@ namespace Ichni.RhythmGame
this.surface.spline = track.trackPathSubmodule.path;
this.surface.clipFrom = 0;
this.surface.clipTo = 1;
this.surface.updateMethod = SplineUser.UpdateMethod.LateUpdate;
this.meshRenderer.material = renderMaterial;
this.surface.color = Color.white;
this.surface.uvRotation = 90;

View File

@@ -8,11 +8,18 @@ namespace Ichni.Editor
{
public class MusicPlayer : MonoBehaviour
{
public bool isDebugging;
public bool isPlaying;
public AudioSource audioSource;
private void Update()
{
if (isDebugging)
{
EditorManager.instance.songInformation.songTime += Time.deltaTime;
return;
}
if (isPlaying)
{
EditorManager.instance.songInformation.songTime = EditorManager.instance.musicPlayer.audioSource.time;