注意:更改了trackpercentpoint的逻辑

Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
2025-08-31 15:27:02 +08:00
parent 84ff356427
commit 27b3cf58d0
40 changed files with 288899 additions and 18281 deletions

View File

@@ -92,10 +92,10 @@ namespace Ichni.RhythmGame
public override void SetDefaultSubmodules()
{
base.SetDefaultSubmodules();
noteAudioSubmodule ??= new NoteAudioSubmodule(this, new List<string>(){"DefaultEndHold"},
noteAudioSubmodule ??= new NoteAudioSubmodule(this, new List<string>() { "DefaultEndHold" },
new List<string>(), new List<string>(),
new List<string>(), new List<string>(),
new List<string>(){"DefaultStartHold"});
new List<string>() { "DefaultStartHold" });
}
public override void SaveBM()
@@ -128,6 +128,7 @@ namespace Ichni.RhythmGame
{
effect.effectTime = holdingTime;
});
holdEndTimeInputField.inputField.text = holdEndTime.ToString();
});
inspector.MarkedElements["ExactJudgeTime"].AddListenerFunction(() =>
{

View File

@@ -11,7 +11,7 @@ using UnityEngine;
namespace Ichni.RhythmGame
{
public partial class PathNode : GameElement, IHaveTransformSubmodule, IHaveTimeDurationSubmodule, IHaveColorSubmodule
public partial class PathNode : GameElement, IHaveTransformSubmodule, IHaveTimeDurationSubmodule, IHaveColorSubmodule, IHaveSelectSubmodule
{
public Track track;
public SplinePoint node;
@@ -22,6 +22,9 @@ namespace Ichni.RhythmGame
public bool haveEmissionColor => false;
public override int HierarchyPriority => -100;
public SelectSubmodule selectSubmodule { get; set; }
[Title("Editor独有参数")]
[SerializeField]
[HideInPlayMode]
@@ -47,7 +50,7 @@ namespace Ichni.RhythmGame
{
track.trackPathSubmodule.pathNodeList.Insert(index, pathNode);
}
pathNode.SetEditorSubmodules();
return pathNode;
}
@@ -58,7 +61,10 @@ namespace Ichni.RhythmGame
timeDurationSubmodule = new TimeDurationSubmodule(this);
colorSubmodule = new ColorSubmodule(this);
}
public override void SetEditorSubmodules()
{
selectSubmodule ??= new SelectSubmodule(this, this);
}
public override void AfterInitialize()
{
@@ -119,7 +125,7 @@ namespace Ichni.RhythmGame
var isShowingSphereToggle =
inspector.GenerateToggle(this, pathNodeSettings, "Is Showing Sphere", nameof(isShowingSphere))
.AddListenerFunction(() => SetPathNodeSphere(isShowingSphere));
var generateAnimation = container.GenerateSubcontainer(3);
StandardInspectionElement.GenerateForTransform(this, container);
var generateBaseColorChangeButton = inspector.GenerateButton(this, generateAnimation, "Base Color Change",

View File

@@ -150,7 +150,17 @@ namespace Ichni.RhythmGame
var trackMajorPointSubcontainer = generateContainer.GenerateSubcontainer(3);
var trackPercentPointButton = inspector.GenerateButton(this, trackMajorPointSubcontainer, "Track Percent Point",
() => { TrackPercentPoint.GenerateElement("New Track Percent Point", Guid.NewGuid(), new List<string>(), true, this, new FlexibleFloat()); }); //百分比点
() =>
{
var a = TrackPercentPoint.GenerateElement("New Track Percent Point", Guid.NewGuid(), new List<string>(), true, this, new FlexibleFloat());
//添加默认动画
if (trackTimeSubmodule != null && trackTimeSubmodule is TrackTimeSubmoduleMovable trackTimeSubmoduleMovable)
a.trackPercent.Add(
new AnimatedFloat(trackTimeSubmoduleMovable.trackStartTime, trackTimeSubmoduleMovable.trackEndTime, 0, 1, AnimationCurveType.Linear)); //添加一个默认的动画
}); //百分比点
var trackHeadPointButton = inspector.GenerateButton(this, trackMajorPointSubcontainer, "Track Head Point",
() => { TrackHeadPoint.GenerateElement("New Track Head Point", Guid.NewGuid(), new List<string>(), true, this, false, Vector3.zero); }); //头部点必须先有TrackTimeSubmoduleMovable
if (trackTimeSubmodule is not TrackTimeSubmoduleMovable) trackHeadPointButton.button.interactable = false;

View File

@@ -22,8 +22,6 @@ namespace Ichni.RhythmGame
public TimeDurationSubmodule timeDurationSubmodule { get; set; }
private bool isBeyond1 = false;
public bool MotionAngles = false;
public static TrackPercentPoint GenerateElement(string elementName, Guid id, List<string> tags,
@@ -39,17 +37,6 @@ namespace Ichni.RhythmGame
point.trackPositioner.spline = track.trackPathSubmodule.path;
point.trackPercent = trackPercent;
point.isBeyond1 = trackPercent.animations.Any(animation => animation.endValue > 1); //判断是否有超过1的动画超过1将会循环
//添加默认动画
if (isFirstGenerated && point.parentElement is Track track1 && track1.submoduleList.Where(submodule => submodule is TrackTimeSubmoduleMovable).Count() == 1)
{
TrackTimeSubmoduleMovable trackTimeSubmoduleMovable = track1.submoduleList.Where(submodule => submodule is TrackTimeSubmoduleMovable).FirstOrDefault() as TrackTimeSubmoduleMovable;
point.trackPercent.Add(
new AnimatedFloat(trackTimeSubmoduleMovable.trackStartTime, trackTimeSubmoduleMovable.trackEndTime, 0, 1, AnimationCurveType.Linear)); //添加一个默认的动画
}
point.trackPositioner.motion.rotationOffset = Vector3.zero;
point.trackPositioner.motion.applyRotation = false;
@@ -69,11 +56,8 @@ namespace Ichni.RhythmGame
if (trackPercent.returnType == FlexibleReturnType.MiddleExecuting)
{
float finalValue = trackPercent.value;
if (finalValue > 1 && finalValue > Mathf.Floor(finalValue)) finalValue -= Mathf.Floor(finalValue);
if (isBeyond1)
{
finalValue -= Mathf.Floor(finalValue);
}
trackPositioner.SetPercent(finalValue);
}
@@ -118,8 +102,8 @@ namespace Ichni.RhythmGame
var generateParticleEmitterButton = inspector.GenerateButton(this, generation, "Generate Particle Emitter", () =>
{
ParticleEmitter.GenerateElement("New Particle Emitter", Guid.NewGuid(), new List<string>(), true,
this, "", "",false,0, 1, ParticleSystemSimulationSpace.World,
10, 5, 1, 1 ,true, Vector3.zero);
this, "", "", false, 0, 1, ParticleSystemSimulationSpace.World,
10, 5, 1, 1, true, Vector3.zero);
});
}