Merge branch 'main' of https://github.com/MiracleForest-Ichni/IchniCreatorStudio
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user