diff --git a/Assets/Scripts/EditorGame/Animations/Transform/LookAt.cs b/Assets/Scripts/EditorGame/Animations/Transform/LookAt.cs index 2c4011d5..da6dfa41 100644 --- a/Assets/Scripts/EditorGame/Animations/Transform/LookAt.cs +++ b/Assets/Scripts/EditorGame/Animations/Transform/LookAt.cs @@ -53,7 +53,7 @@ namespace Ichni.RhythmGame { if (lookAtObject == null) return; - enabling.UpdateFlexibleBool(EditorManager.instance.songInformation.songTime); + enabling.UpdateFlexibleBool(songTime); if (!targetTransformSubmodule.eulerAnglesOffsetLock || enabling.value) { diff --git a/Assets/Scripts/EditorGame/GameElements/Track/Track.cs b/Assets/Scripts/EditorGame/GameElements/Track/Track.cs index b66f0e4a..3e65e15c 100644 --- a/Assets/Scripts/EditorGame/GameElements/Track/Track.cs +++ b/Assets/Scripts/EditorGame/GameElements/Track/Track.cs @@ -151,7 +151,7 @@ namespace Ichni.RhythmGame var trackPercentPointButton = inspector.GenerateButton(this, trackMajorPointSubcontainer, "Track Percent Point", () => { TrackPercentPoint.GenerateElement("New Track Percent Point", Guid.NewGuid(), new List(), true, this, new FlexibleFloat()); }); //百分比点 var trackHeadPointButton = inspector.GenerateButton(this, trackMajorPointSubcontainer, "Track Head Point", - () => { TrackHeadPoint.GenerateElement("New Track Head Point", Guid.NewGuid(), new List(), true, this); }); //头部点(必须先有TrackTimeSubmoduleMovable) + () => { TrackHeadPoint.GenerateElement("New Track Head Point", Guid.NewGuid(), new List(), true, this, false); }); //头部点(必须先有TrackTimeSubmoduleMovable) if (trackTimeSubmodule is not TrackTimeSubmoduleMovable) trackHeadPointButton.button.interactable = false; var noteSubcontainer = generateContainer.GenerateSubcontainer(3); diff --git a/Assets/Scripts/EditorGame/GameElements/Track/TrackPoints/CrossTrackPoint.cs b/Assets/Scripts/EditorGame/GameElements/Track/TrackPoints/CrossTrackPoint.cs index 206a670f..4d64c06b 100644 --- a/Assets/Scripts/EditorGame/GameElements/Track/TrackPoints/CrossTrackPoint.cs +++ b/Assets/Scripts/EditorGame/GameElements/Track/TrackPoints/CrossTrackPoint.cs @@ -35,6 +35,7 @@ namespace Ichni.RhythmGame point.trackSwitch = trackSwitch; point.trackPercent = trackPercent; + point.trackPositioner.motion.rotationOffset = Vector3.zero; point.trackPositioner.motion.applyRotation = false; return point; diff --git a/Assets/Scripts/EditorGame/GameElements/Track/TrackPoints/TrackHeadPoint.cs b/Assets/Scripts/EditorGame/GameElements/Track/TrackPoints/TrackHeadPoint.cs index 575c9ac7..b5b1e445 100644 --- a/Assets/Scripts/EditorGame/GameElements/Track/TrackPoints/TrackHeadPoint.cs +++ b/Assets/Scripts/EditorGame/GameElements/Track/TrackPoints/TrackHeadPoint.cs @@ -6,6 +6,7 @@ using Ichni.Editor; using Ichni.RhythmGame.Beatmap; using Lean.Pool; using UnityEngine; +using UnityEngine.Serialization; namespace Ichni.RhythmGame { @@ -16,14 +17,12 @@ namespace Ichni.RhythmGame public SplinePositioner trackPositioner; public TimeDurationSubmodule timeDurationSubmodule { get; set; } - public bool MotionAngles = false; + public bool motionApplyRotation; private float SongTime => EditorManager.instance.songInformation.songTime; public static TrackHeadPoint GenerateElement(string elementName, Guid id, List tags, - bool isFirstGenerated, Track track) - - + bool isFirstGenerated, Track track, bool motionApplyRotation) { TrackHeadPoint head = Instantiate(EditorManager.instance.basePrefabs.emptyObject, track.transform) .AddComponent(); @@ -33,9 +32,9 @@ namespace Ichni.RhythmGame head.trackPositioner = head.gameObject.AddComponent(); head.trackPositioner.spline = track.trackPathSubmodule.path; head.trackTimeSubmoduleMovable = track.trackTimeSubmodule as TrackTimeSubmoduleMovable; - - head.trackPositioner.motion.applyRotation = false; - // head.trackPositioner.updateMethod = SplinePositioner.UpdateMethod.Update; + + head.motionApplyRotation = motionApplyRotation; + head.trackPositioner.motion.applyRotation = motionApplyRotation; return head; } @@ -59,10 +58,7 @@ namespace Ichni.RhythmGame public override void SaveBM() { // 保存MotionAngles到BM - matchedBM = new TrackHeadPoint_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM) - { - MotionAngles = this.MotionAngles - }; + matchedBM = new TrackHeadPoint_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM, motionApplyRotation); } public override void SetUpInspector() @@ -72,7 +68,8 @@ namespace Ichni.RhythmGame IHaveInspection inspector = EditorManager.instance.uiManager.inspector; var container = inspector.GenerateContainer("Track Percent Point"); var MotionAngles = container.GenerateSubcontainer(3); - var MotionAnglesT = inspector.GenerateToggle(this, MotionAngles, "Motion With Angles", nameof(MotionAngles)); + var MotionAnglesT = inspector.GenerateToggle(this, MotionAngles, "Motion With Angles", nameof(motionApplyRotation)); + var generation = container.GenerateSubcontainer(3); var generateTrailButton = inspector.GenerateButton(this, generation, "Generate Trail", () => { @@ -87,7 +84,7 @@ namespace Ichni.RhythmGame public override void Refresh() { base.Refresh(); - trackPositioner.motion.applyRotation = MotionAngles; + trackPositioner.motion.applyRotation = motionApplyRotation; this.transform.eulerAngles = Vector3.zero; } } @@ -97,7 +94,7 @@ namespace Ichni.RhythmGame public class TrackHeadPoint_BM : GameElement_BM { // 新增属性 - public bool MotionAngles = false; + public bool motionApplyRotation = false; public TrackHeadPoint_BM() { @@ -105,31 +102,23 @@ namespace Ichni.RhythmGame } public TrackHeadPoint_BM(string elementName, Guid elementGuid, List tags, - GameElement_BM attachedElement) + GameElement_BM attachedElement, bool motionApplyRotation) : base(elementName, elementGuid, tags, attachedElement) { + this.motionApplyRotation = motionApplyRotation; } public override void ExecuteBM() { var element = TrackHeadPoint.GenerateElement(elementName, elementGuid, tags, false, - GetElement(attachedElementGuid) as Track); + GetElement(attachedElementGuid) as Track, motionApplyRotation); matchedElement = element; - // 还原MotionAngles - if (element is TrackHeadPoint thp && this != null) - { - thp.MotionAngles = this.MotionAngles; - } } public override GameElement DuplicateBM(GameElement parent) { - var newElement = TrackHeadPoint.GenerateElement(elementName, Guid.NewGuid(), tags, false, parent as Track); - // 复制MotionAngles - if (newElement is TrackHeadPoint thp) - { - thp.MotionAngles = this.MotionAngles; - } + var newElement = TrackHeadPoint.GenerateElement(elementName, Guid.NewGuid(), tags, + false, parent as Track, motionApplyRotation); return newElement; } } diff --git a/Assets/Scripts/EditorGame/GameElements/Track/TrackPoints/TrackPercentPoint.cs b/Assets/Scripts/EditorGame/GameElements/Track/TrackPoints/TrackPercentPoint.cs index eb173874..1948260c 100644 --- a/Assets/Scripts/EditorGame/GameElements/Track/TrackPoints/TrackPercentPoint.cs +++ b/Assets/Scripts/EditorGame/GameElements/Track/TrackPoints/TrackPercentPoint.cs @@ -40,8 +40,7 @@ namespace Ichni.RhythmGame point.trackPercent = trackPercent; point.isBeyond1 = trackPercent.animations.Any(animation => animation.endValue > 1); //判断是否有超过1的动画,超过1将会循环 - - + //添加默认动画 if (point.parentElement is Track track1 && track1.submoduleList.Where(submodule => submodule is TrackTimeSubmoduleMovable).Count() == 1) { @@ -51,6 +50,7 @@ namespace Ichni.RhythmGame } + point.trackPositioner.motion.rotationOffset = Vector3.zero; point.trackPositioner.motion.applyRotation = false; return point; diff --git a/Assets/StreamingAssets/Export/world for white.meta b/Assets/StreamingAssets/Export/world for white.meta new file mode 100644 index 00000000..818ceb82 --- /dev/null +++ b/Assets/StreamingAssets/Export/world for white.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d19c107ad2c7f024fae94cf9f55d7869 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/Export/world for white/Beatmap.bytes b/Assets/StreamingAssets/Export/world for white/Beatmap.bytes new file mode 100644 index 00000000..f8e6fe05 Binary files /dev/null and b/Assets/StreamingAssets/Export/world for white/Beatmap.bytes differ diff --git a/Assets/NLayer/NLayer.csproj.meta b/Assets/StreamingAssets/Export/world for white/Beatmap.bytes.meta similarity index 74% rename from Assets/NLayer/NLayer.csproj.meta rename to Assets/StreamingAssets/Export/world for white/Beatmap.bytes.meta index e0885ac2..105ca000 100644 --- a/Assets/NLayer/NLayer.csproj.meta +++ b/Assets/StreamingAssets/Export/world for white/Beatmap.bytes.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6dbdd314784e80440b48088e6357c1ef +guid: 640419a82dfcbed46a989fbbf01ae5ad DefaultImporter: externalObjects: {} userData: diff --git a/Assets/StreamingAssets/Export/world for white/CommandScripts.bytes b/Assets/StreamingAssets/Export/world for white/CommandScripts.bytes new file mode 100644 index 00000000..ad8eea5b --- /dev/null +++ b/Assets/StreamingAssets/Export/world for white/CommandScripts.bytes @@ -0,0 +1,2 @@ +")=-olq2o:k(N9lM42`  +NQ2efqk( 3Gv5+,3EOS Qd @us|QPo)Ioo< h*xiG3:z&˾" MČ{- v"<5cgp%`Δ1| \yyېD [!7GMgt \ No newline at end of file diff --git a/Assets/StreamingAssets/Export/world for white/SongInfo.bytes.meta b/Assets/StreamingAssets/Export/world for white/SongInfo.bytes.meta new file mode 100644 index 00000000..22fb935e --- /dev/null +++ b/Assets/StreamingAssets/Export/world for white/SongInfo.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 32ea8950ec2c62f48949b008c82bb714 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/Projects/world for white/Beatmap.json b/Assets/StreamingAssets/Projects/world for white/Beatmap.json index f0d1e49d..c87b2646 100644 --- a/Assets/StreamingAssets/Projects/world for white/Beatmap.json +++ b/Assets/StreamingAssets/Projects/world for white/Beatmap.json @@ -3376,7 +3376,7 @@ } },{ "__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp", - "MotionAngles" : false, + "motionApplyRotation" : false, "elementName" : "New Track Head Point", "tags" : [ @@ -4968,7 +4968,7 @@ } },{ "__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp", - "MotionAngles" : false, + "motionApplyRotation" : false, "elementName" : "New Track Head Point", "tags" : [ @@ -11507,7 +11507,7 @@ } },{ "__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp", - "MotionAngles" : false, + "motionApplyRotation" : false, "elementName" : "New Track Head Point", "tags" : [ @@ -27017,7 +27017,7 @@ } },{ "__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp", - "MotionAngles" : false, + "motionApplyRotation" : false, "elementName" : "New Track Head Point", "tags" : [ @@ -27276,7 +27276,7 @@ } },{ "__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp", - "MotionAngles" : false, + "motionApplyRotation" : false, "elementName" : "New Track Head Point", "tags" : [ @@ -35728,7 +35728,7 @@ ], "elementGuid" : { - "value" : "eeb24fad-4048-4368-a826-e2515492b793" + "value" : "c3c6ad63-3e8d-485e-a1a4-440691705958" }, "attachedElementGuid" : { "value" : "ff8926ef-e06e-4f85-837f-2b3948290d18" @@ -35751,7 +35751,7 @@ "z" : 1 }, "attachedElementGuid" : { - "value" : "eeb24fad-4048-4368-a826-e2515492b793" + "value" : "c3c6ad63-3e8d-485e-a1a4-440691705958" } },{ "__type" : "Ichni.RhythmGame.Beatmap.EffectSubmodule_BM,Assembly-CSharp", @@ -35791,7 +35791,7 @@ ] }, "attachedElementGuid" : { - "value" : "eeb24fad-4048-4368-a826-e2515492b793" + "value" : "c3c6ad63-3e8d-485e-a1a4-440691705958" } },{ "__type" : "Ichni.RhythmGame.Beatmap.Tap_BM,Assembly-CSharp", @@ -45739,7 +45739,7 @@ } },{ "__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp", - "MotionAngles" : false, + "motionApplyRotation" : false, "elementName" : "New Track Head Point", "tags" : [ @@ -46176,7 +46176,7 @@ ], "elementGuid" : { - "value" : "4afb4752-96f4-4697-b9f9-f2fc421b4eb2" + "value" : "38355e42-c3d5-4776-8435-fd5c37e75af6" }, "attachedElementGuid" : { "value" : "ff8926ef-e06e-4f85-837f-2b3948290d18" @@ -46199,7 +46199,7 @@ "z" : 1 }, "attachedElementGuid" : { - "value" : "4afb4752-96f4-4697-b9f9-f2fc421b4eb2" + "value" : "38355e42-c3d5-4776-8435-fd5c37e75af6" } },{ "__type" : "Ichni.RhythmGame.Beatmap.EffectSubmodule_BM,Assembly-CSharp", @@ -46269,7 +46269,7 @@ ] }, "attachedElementGuid" : { - "value" : "4afb4752-96f4-4697-b9f9-f2fc421b4eb2" + "value" : "38355e42-c3d5-4776-8435-fd5c37e75af6" } },{ "__type" : "Ichni.RhythmGame.Beatmap.ElementFolder_BM,Assembly-CSharp", @@ -46491,7 +46491,7 @@ } },{ "__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp", - "MotionAngles" : false, + "motionApplyRotation" : true, "elementName" : "New Track Head Point", "tags" : [ @@ -55265,7 +55265,7 @@ ], "elementGuid" : { - "value" : "eb2e66ac-bcdb-4c25-87d9-0b1f110c8173" + "value" : "2d033af4-9e42-4a75-ab36-d02cae9349a7" }, "attachedElementGuid" : { "value" : "ff8926ef-e06e-4f85-837f-2b3948290d18" @@ -55288,7 +55288,7 @@ "z" : 1 }, "attachedElementGuid" : { - "value" : "eb2e66ac-bcdb-4c25-87d9-0b1f110c8173" + "value" : "2d033af4-9e42-4a75-ab36-d02cae9349a7" } },{ "__type" : "Ichni.RhythmGame.Beatmap.EffectSubmodule_BM,Assembly-CSharp", @@ -55328,7 +55328,7 @@ ] }, "attachedElementGuid" : { - "value" : "eb2e66ac-bcdb-4c25-87d9-0b1f110c8173" + "value" : "2d033af4-9e42-4a75-ab36-d02cae9349a7" } },{ "__type" : "Ichni.RhythmGame.Beatmap.ElementFolder_BM,Assembly-CSharp", @@ -62260,7 +62260,7 @@ } },{ "__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp", - "MotionAngles" : false, + "motionApplyRotation" : false, "elementName" : "New Track Head Point", "tags" : [ @@ -62687,7 +62687,7 @@ } },{ "__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp", - "MotionAngles" : false, + "motionApplyRotation" : false, "elementName" : "New Track Head Point", "tags" : [ @@ -63114,7 +63114,7 @@ } },{ "__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp", - "MotionAngles" : false, + "motionApplyRotation" : false, "elementName" : "New Track Head Point", "tags" : [ @@ -63391,7 +63391,7 @@ } },{ "__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp", - "MotionAngles" : false, + "motionApplyRotation" : false, "elementName" : "New Track Head Point", "tags" : [ @@ -63668,7 +63668,7 @@ } },{ "__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp", - "MotionAngles" : false, + "motionApplyRotation" : false, "elementName" : "New Track Head Point", "tags" : [ @@ -64435,7 +64435,7 @@ } },{ "__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp", - "MotionAngles" : false, + "motionApplyRotation" : false, "elementName" : "New Track Head Point", "tags" : [ @@ -64862,7 +64862,7 @@ } },{ "__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp", - "MotionAngles" : false, + "motionApplyRotation" : false, "elementName" : "New Track Head Point", "tags" : [ @@ -65289,7 +65289,7 @@ } },{ "__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp", - "MotionAngles" : false, + "motionApplyRotation" : false, "elementName" : "New Track Head Point", "tags" : [ @@ -65566,7 +65566,7 @@ } },{ "__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp", - "MotionAngles" : false, + "motionApplyRotation" : false, "elementName" : "New Track Head Point", "tags" : [ @@ -65993,7 +65993,7 @@ } },{ "__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp", - "MotionAngles" : false, + "motionApplyRotation" : false, "elementName" : "New Track Head Point", "tags" : [ @@ -72378,7 +72378,7 @@ } },{ "__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp", - "MotionAngles" : false, + "motionApplyRotation" : false, "elementName" : "New Track Head Point", "tags" : [ @@ -73292,7 +73292,7 @@ } },{ "__type" : "Ichni.RhythmGame.Beatmap.TrackHeadPoint_BM,Assembly-CSharp", - "MotionAngles" : false, + "motionApplyRotation" : false, "elementName" : "New Track Head Point", "tags" : [