This commit is contained in:
2025-07-18 18:44:24 +08:00
15 changed files with 85 additions and 60 deletions

View File

@@ -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)
{

View File

@@ -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<string>(), true, this, new FlexibleFloat()); }); //百分比点
var trackHeadPointButton = inspector.GenerateButton(this, trackMajorPointSubcontainer, "Track Head Point",
() => { TrackHeadPoint.GenerateElement("New Track Head Point", Guid.NewGuid(), new List<string>(), true, this); }); //头部点必须先有TrackTimeSubmoduleMovable
() => { TrackHeadPoint.GenerateElement("New Track Head Point", Guid.NewGuid(), new List<string>(), true, this, false); }); //头部点必须先有TrackTimeSubmoduleMovable
if (trackTimeSubmodule is not TrackTimeSubmoduleMovable) trackHeadPointButton.button.interactable = false;
var noteSubcontainer = generateContainer.GenerateSubcontainer(3);

View File

@@ -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;

View File

@@ -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<string> tags,
bool isFirstGenerated, Track track)
bool isFirstGenerated, Track track, bool motionApplyRotation)
{
TrackHeadPoint head = Instantiate(EditorManager.instance.basePrefabs.emptyObject, track.transform)
.AddComponent<TrackHeadPoint>();
@@ -33,9 +32,9 @@ namespace Ichni.RhythmGame
head.trackPositioner = head.gameObject.AddComponent<SplinePositioner>();
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<string> 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;
}
}

View File

@@ -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;

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d19c107ad2c7f024fae94cf9f55d7869
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 6dbdd314784e80440b48088e6357c1ef
guid: 640419a82dfcbed46a989fbbf01ae5ad
DefaultImporter:
externalObjects: {}
userData:

View File

@@ -0,0 +1,2 @@
ž")ÜŘ=źż˝-oްlqĄéö2o:ÔÜk—(N9lM<6C>4©2` îđüˇ<10>
§NQ2eě·f<EFBFBD>qkî( 3Ýóś ÁGĄv¨5+€<¦H

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3520d0c4c86041a48ad52c923e947039
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,3 @@
xč¸ç…[aĂ8ďę¶Kô5Đ<35>fdčç&8[<5B>ŻČpFdR!ÂŮČsF<14>őR}Y×pĚÜÁňĺˇQŞŕő/ őh«bb2pŰ$«ÎV,n^a*ˇ
(żBIo}§×x*¦)ĎKTĚ<54>­ĺ©WĂăĽŕćĺ˙íůĎ)ţ(ŐÝݳҪF(¶˝<C2B6>DJý˙O¦©™ÁSuÓ÷Ú`dzµÚăŐ9¶˘Ao4eůúŔ1îD˝1ăž@ä_
¸x“1| Ľ‰öx}0ÝĽ'6 űćˇĂMŘ2,O09X˘šbbŰ“řo|±°IٍůQk=[Ő…#ěĂńX;-ź(ňl<04>´ď;÷´`Ěj·@6JOäwm`C|v™{ŇŤĚŚě×°âŰ2e¨6mv¦á.oŰM»ô8ťU¸Ć

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2b64f525670b05c4e96f718c31cd34ef
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1 @@
4a.õnS×åÜfôp«ûQ…sŠ©áŧÔ]p“Åû9m'_b„¶}…$”u§iRÑfØá?>,3½E·»OS QdÙüó @öu£s|¥QPo¥)Io<49>Æo<ò™ øûh*©ËÈ£´xÇiî×G3:£ãz&˾" MÄŒŠ…{¼Ã-ò<> ´v"õ<¶„Í5c³gŽÊp%´`ËΔÕë1| ‡Ù\·ÄyÓßÇyÒÛ<C392>Üä±D¸‚« ê[!7€ÆGŠäMùgÄtý®Þ

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 32ea8950ec2c62f48949b008c82bb714
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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" : [