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

This commit is contained in:
2025-08-09 19:13:11 +08:00
parent 8da603c702
commit 0ac0c6228d
15 changed files with 35121 additions and 2349 deletions

View File

@@ -231,13 +231,15 @@ namespace Ichni.RhythmGame
var timeField = qcWindow.GenerateInputField(qcSubcontainer, "Time offset", "0");
var iterationField = qcWindow.GenerateInputField(qcSubcontainer, "Iteration", "0");
var includeAnimationToggle = qcWindow.GenerateToggle(null, qcSubcontainer, "Include Animation", string.Empty);
var MovingTrackToggle = qcWindow.GenerateToggle(null, qcSubcontainer, "Moving Track or PathNode", string.Empty);
qcWindow.GenerateButton(this, qcSubcontainer, "Copy", () =>
{
Vector3 positionOffset = new Vector3(xField.GetValue<float>(), yField.GetValue<float>(), zField.GetValue<float>());
float timeOffset = timeField.GetValue<float>();
int iteration = iterationField.GetValue<int>();
bool includeAnimation = includeAnimationToggle.toggle.isOn;
QuickCopy(positionOffset, timeOffset, includeAnimation, iteration);
bool MovingTrack = MovingTrackToggle.toggle.isOn;
QuickCopy(positionOffset, timeOffset, includeAnimation, iteration, MovingTrack);
});
}); //快速复制

View File

@@ -32,7 +32,7 @@ namespace Ichni.RhythmGame
head.trackPositioner = head.gameObject.AddComponent<SplinePositioner>();
head.trackPositioner.spline = track.trackPathSubmodule.path;
head.trackTimeSubmoduleMovable = track.trackTimeSubmodule as TrackTimeSubmoduleMovable;
head.motionApplyRotation = motionApplyRotation;
head.trackPositioner.motion.applyRotation = motionApplyRotation;
@@ -69,7 +69,7 @@ namespace Ichni.RhythmGame
var container = inspector.GenerateContainer("Track Percent Point");
var MotionAngles = container.GenerateSubcontainer(3);
var MotionAnglesT = inspector.GenerateToggle(this, MotionAngles, "Motion With Angles", nameof(motionApplyRotation));
var generation = container.GenerateSubcontainer(3);
var generateTrailButton = inspector.GenerateButton(this, generation, "Generate Trail", () =>
{
@@ -85,7 +85,7 @@ namespace Ichni.RhythmGame
{
base.Refresh();
trackPositioner.motion.applyRotation = motionApplyRotation;
this.transform.eulerAngles = Vector3.zero;
this.transform.localEulerAngles = Vector3.zero;
}
}

View File

@@ -58,6 +58,7 @@ namespace Ichni.RhythmGame
meshRenderer.material = renderMaterial;
}
public override void Refresh()
{
SetEnableZWrite();

View File

@@ -15,7 +15,7 @@ namespace Ichni.RhythmGame
/// <param name="unitPositionOffset">单位位置整体偏移</param>
/// <param name="unitTimeOffset">单位时间偏移</param>
/// <param name="iteration">迭代次数即产生几个粘贴的Track</param>
private void QuickCopy(Vector3 unitPositionOffset, float unitTimeOffset, bool includeAnimations = true, int iteration = 1)
private void QuickCopy(Vector3 unitPositionOffset, float unitTimeOffset, bool includeAnimations = true, int iteration = 1, bool MovingTrack = false)
{
if (iteration <= 0) return;
@@ -29,14 +29,20 @@ namespace Ichni.RhythmGame
float timeOffset = unitTimeOffset * i;
//以下对Track的所有有效的Submodule和子GameElement进行偏移 TODO: 需要思考是否有统一时间偏移的方法?
//PathNode位置偏移
newTrack.trackPathSubmodule.pathNodeList.ForEach(pn =>
if (MovingTrack)
{
pn.transformSubmodule.originalPosition += positionOffset;
pn.transformSubmodule.Refresh();
});
newTrack.transformSubmodule.originalPosition += positionOffset;
newTrack.transformSubmodule.Refresh();
}
else
{
//PathNode位置偏移
newTrack.trackPathSubmodule.pathNodeList.ForEach(pn =>
{
pn.transformSubmodule.originalPosition += positionOffset;
pn.transformSubmodule.Refresh();
});
}
//TrackTimeSubmoduleMovable时间偏移
if (newTrack.trackTimeSubmodule is TrackTimeSubmoduleMovable movable)
{