perf
This commit is contained in:
@@ -28,7 +28,7 @@ namespace Ichni.RhythmGame
|
||||
point.trackListFolder = elementFolder;
|
||||
point.trackSwitch = trackSwitch;
|
||||
point.trackPercent = trackPercent;
|
||||
|
||||
point.trackPositioner.motion.applyRotation = false;
|
||||
return point;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,9 +13,10 @@ namespace Ichni.RhythmGame
|
||||
public SplinePositioner trackPositioner;
|
||||
|
||||
public TimeDurationSubmodule timeDurationSubmodule { get; set; }
|
||||
|
||||
public bool motionApplyRotation;
|
||||
|
||||
public static TrackHeadPoint GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, Track track)
|
||||
bool isFirstGenerated, Track track, bool motionApplyRotation)
|
||||
{
|
||||
TrackHeadPoint head = Instantiate(GameManager.instance.basePrefabs.emptyObject, track.transform).AddComponent<TrackHeadPoint>();
|
||||
|
||||
@@ -24,6 +25,9 @@ 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;
|
||||
return head;
|
||||
}
|
||||
|
||||
@@ -45,7 +49,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new TrackHeadPoint_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM);
|
||||
matchedBM = new TrackHeadPoint_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM, motionApplyRotation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,26 +57,29 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public class TrackHeadPoint_BM : GameElement_BM
|
||||
{
|
||||
public bool motionApplyRotation = false;
|
||||
|
||||
public TrackHeadPoint_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public TrackHeadPoint_BM(string elementName, Guid elementGuid, List<string> tags,
|
||||
GameElement_BM attachedElement)
|
||||
GameElement_BM attachedElement, bool motionApplyRotation)
|
||||
: base(elementName, elementGuid, tags, attachedElement)
|
||||
{
|
||||
this.motionApplyRotation = motionApplyRotation;
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = TrackHeadPoint.GenerateElement(elementName, elementGuid, tags, false,
|
||||
GetElement(attachedElementGuid) as Track);
|
||||
GetElement(attachedElementGuid) as Track, motionApplyRotation);
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
return TrackHeadPoint.GenerateElement(elementName, Guid.NewGuid(), tags, false, parent as Track);
|
||||
return TrackHeadPoint.GenerateElement(elementName, Guid.NewGuid(), tags, false, parent as Track, motionApplyRotation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Ichni.RhythmGame
|
||||
point.trackPercent = trackPercent;
|
||||
|
||||
point.isBeyond1 = trackPercent.animations.Any(animation => animation.endValue > 1); //判断是否有超过1的动画,超过1将会循环
|
||||
|
||||
point.trackPositioner.motion.applyRotation = false;
|
||||
return point;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user