Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}); //快速复制
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ namespace Ichni.RhythmGame
|
||||
meshRenderer.material = renderMaterial;
|
||||
}
|
||||
|
||||
|
||||
public override void Refresh()
|
||||
{
|
||||
SetEnableZWrite();
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user