加加加加
This commit is contained in:
@@ -18,9 +18,11 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public FlexibleInt trackSwitch;
|
||||
public FlexibleFloat trackPercent;
|
||||
|
||||
|
||||
public TimeDurationSubmodule timeDurationSubmodule { get; set; }
|
||||
|
||||
public bool MotionAngles = false;
|
||||
|
||||
public static CrossTrackPoint GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, ElementFolder elementFolder, FlexibleInt trackSwitch, FlexibleFloat trackPercent)
|
||||
{
|
||||
@@ -55,7 +57,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
private void SetPoint()
|
||||
{
|
||||
if (nowAttachedTrackIndex != trackSwitch.value &&
|
||||
if (nowAttachedTrackIndex != trackSwitch.value &&
|
||||
trackSwitch.value >= 0 &&
|
||||
trackSwitch.value < trackListFolder.trackList.Count)
|
||||
{
|
||||
@@ -63,7 +65,7 @@ namespace Ichni.RhythmGame
|
||||
nowAttachedTrackIndex = trackSwitch.value;
|
||||
trackPositioner.spline = trackListFolder.trackList[trackSwitch.value].trackPathSubmodule.path;
|
||||
}
|
||||
|
||||
|
||||
trackPositioner.SetPercent(trackPercent.value);
|
||||
}
|
||||
|
||||
@@ -88,13 +90,16 @@ namespace Ichni.RhythmGame
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new CrossTrackPoint_BM(elementName, elementGuid, tags,
|
||||
parentElement.matchedBM as GameElement_BM, trackSwitch, trackPercent);
|
||||
parentElement.matchedBM as GameElement_BM, trackSwitch, trackPercent)
|
||||
{
|
||||
MotionAngles = this.MotionAngles
|
||||
};
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
|
||||
|
||||
base.SetUpInspector();
|
||||
var container = inspector.GenerateContainer("Cross Track Point");
|
||||
var pointSettings = container.GenerateSubcontainer(3);
|
||||
@@ -108,18 +113,30 @@ namespace Ichni.RhythmGame
|
||||
});
|
||||
var pasteTrackListButton = inspector.GenerateButton(this, pointSettings, "Paste Track List", PasteTrackList);
|
||||
|
||||
// 新增MotionAngles开关
|
||||
var motionAnglesToggle = inspector.GenerateToggle(this, pointSettings, "Motion With Angles", nameof(MotionAngles));
|
||||
|
||||
var generation = container.GenerateSubcontainer(3);
|
||||
var generateCameraButton = inspector.GenerateButton(this, generation, "Game Camera",
|
||||
() => GameCamera.GenerateElement("New Game Camera", Guid.NewGuid(), new List<string>(),
|
||||
() => GameCamera.GenerateElement("New Game Camera", Guid.NewGuid(), new List<string>(),
|
||||
true, this, GameCamera.CameraViewType.Perspective, 60, 10));
|
||||
var generateTrailButton = inspector.GenerateButton(this, generation, "Trail",
|
||||
() => Trail.GenerateElement("New Trail", Guid.NewGuid(), new List<string>(),
|
||||
true, this, 1, true, 1,
|
||||
AnimationCurve.Constant(0,1,1), ColorExtensions.DefaultGradient()));
|
||||
() => Trail.GenerateElement("New Trail", Guid.NewGuid(), new List<string>(),
|
||||
true, this, 1, true, 1,
|
||||
AnimationCurve.Constant(0, 1, 1), ColorExtensions.DefaultGradient()));
|
||||
var environmentObjectButton = inspector.GenerateButton(this, generation, "Environment Object",
|
||||
() => TemporaryObject.GenerateElement("New Environment Object", Guid.NewGuid(), new List<string>(),
|
||||
true, this));
|
||||
}
|
||||
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
if (trackPositioner != null && trackPositioner.motion != null)
|
||||
trackPositioner.motion.applyRotation = MotionAngles;
|
||||
|
||||
this.transform.eulerAngles = Vector3.zero;
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
@@ -128,6 +145,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public FlexibleInt trackSwitch;
|
||||
public FlexibleFloat trackPercent;
|
||||
public bool MotionAngles = false;
|
||||
|
||||
public CrossTrackPoint_BM()
|
||||
{
|
||||
@@ -144,14 +162,26 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = CrossTrackPoint.GenerateElement(elementName, elementGuid, tags, false,
|
||||
var element = CrossTrackPoint.GenerateElement(elementName, elementGuid, tags, false,
|
||||
GetElement(attachedElementGuid) as ElementFolder, trackSwitch, trackPercent);
|
||||
matchedElement = element;
|
||||
// 还原MotionAngles
|
||||
if (element is CrossTrackPoint ctp && this != null)
|
||||
{
|
||||
ctp.MotionAngles = this.MotionAngles;
|
||||
}
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
return CrossTrackPoint.GenerateElement(elementName, Guid.NewGuid(), tags, false,
|
||||
var newElement = CrossTrackPoint.GenerateElement(elementName, Guid.NewGuid(), tags, false,
|
||||
parent as ElementFolder, trackSwitch, trackPercent);
|
||||
// 复制MotionAngles
|
||||
if (newElement is CrossTrackPoint ctp)
|
||||
{
|
||||
ctp.MotionAngles = this.MotionAngles;
|
||||
}
|
||||
return newElement;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Ichni.RhythmGame
|
||||
public SplinePositioner trackPositioner;
|
||||
|
||||
public TimeDurationSubmodule timeDurationSubmodule { get; set; }
|
||||
|
||||
public bool MotionAngles = false;
|
||||
public static TrackHeadPoint GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, Track track)
|
||||
{
|
||||
@@ -28,9 +28,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;
|
||||
|
||||
|
||||
return head;
|
||||
}
|
||||
|
||||
@@ -52,33 +52,47 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new TrackHeadPoint_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM);
|
||||
// 保存MotionAngles到BM
|
||||
matchedBM = new TrackHeadPoint_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM)
|
||||
{
|
||||
MotionAngles = this.MotionAngles
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
base.SetUpInspector();
|
||||
|
||||
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 generation = container.GenerateSubcontainer(3);
|
||||
var generateTrailButton = inspector.GenerateButton(this, generation, "Generate Trail", () =>
|
||||
{
|
||||
Trail.GenerateElement("New Trail", Guid.NewGuid(), new List<string>(), true,
|
||||
this, 1, true, 1,
|
||||
Trail.GenerateElement("New Trail", Guid.NewGuid(), new List<string>(), true,
|
||||
this, 1, true, 1,
|
||||
AnimationCurve.Constant(0, 1, 1), ColorExtensions.DefaultGradient());
|
||||
});
|
||||
var environmentObjectButton = inspector.GenerateButton(this, generation, "Environment Object",
|
||||
() => TemporaryObject.GenerateElement("New Environment Object", Guid.NewGuid(), new List<string>(),
|
||||
true, this));
|
||||
}
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
trackPositioner.motion.applyRotation = MotionAngles;
|
||||
this.transform.eulerAngles = Vector3.zero;
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class TrackHeadPoint_BM : GameElement_BM
|
||||
{
|
||||
// 新增属性
|
||||
public bool MotionAngles = false;
|
||||
|
||||
public TrackHeadPoint_BM()
|
||||
{
|
||||
|
||||
@@ -92,13 +106,25 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = TrackHeadPoint.GenerateElement(elementName, elementGuid, tags, false,
|
||||
var element = TrackHeadPoint.GenerateElement(elementName, elementGuid, tags, false,
|
||||
GetElement(attachedElementGuid) as Track);
|
||||
matchedElement = element;
|
||||
// 还原MotionAngles
|
||||
if (element is TrackHeadPoint thp && this != null)
|
||||
{
|
||||
thp.MotionAngles = this.MotionAngles;
|
||||
}
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
return TrackHeadPoint.GenerateElement(elementName, Guid.NewGuid(), tags, false, parent as Track);
|
||||
var newElement = TrackHeadPoint.GenerateElement(elementName, Guid.NewGuid(), tags, false, parent as Track);
|
||||
// 复制MotionAngles
|
||||
if (newElement is TrackHeadPoint thp)
|
||||
{
|
||||
thp.MotionAngles = this.MotionAngles;
|
||||
}
|
||||
return newElement;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ namespace Ichni.RhythmGame
|
||||
|
||||
private bool isBeyond1 = false;
|
||||
|
||||
public bool MotionAngles = false;
|
||||
|
||||
public static TrackPercentPoint GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated,
|
||||
Track track, FlexibleFloat trackPercent)
|
||||
@@ -50,7 +52,7 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
|
||||
point.trackPositioner.motion.applyRotation = false;
|
||||
|
||||
|
||||
return point;
|
||||
}
|
||||
|
||||
@@ -85,7 +87,10 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
matchedBM = new TrackPercentPoint_BM(elementName, elementGuid, tags,
|
||||
parentElement.matchedBM as GameElement_BM,
|
||||
trackPercent.ConvertToBM());
|
||||
trackPercent.ConvertToBM())
|
||||
{
|
||||
MotionAngles = this.MotionAngles
|
||||
};
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
@@ -98,17 +103,29 @@ namespace Ichni.RhythmGame
|
||||
var trackPercentButton = inspector.GenerateButton(this, pointSettings, "Track Percent",
|
||||
() => { inspector.GenerateCompositeParameterWindow(this, "Track Percent", nameof(trackPercent)).SetAsFlexibleFloat(); });
|
||||
|
||||
// 新增MotionAngles开关
|
||||
var motionAnglesToggle = inspector.GenerateToggle(this, pointSettings, "Motion With Angles", nameof(MotionAngles));
|
||||
|
||||
var generation = container.GenerateSubcontainer(3);
|
||||
var generateTrailButton = inspector.GenerateButton(this, generation, "Generate Trail", () =>
|
||||
{
|
||||
Trail.GenerateElement("New Trail", Guid.NewGuid(), new List<string>(), true,
|
||||
this, 1, true, 1,
|
||||
Trail.GenerateElement("New Trail", Guid.NewGuid(), new List<string>(), true,
|
||||
this, 1, true, 1,
|
||||
AnimationCurve.Constant(0, 1, 1), ColorExtensions.DefaultGradient());
|
||||
});
|
||||
var environmentObjectButton = inspector.GenerateButton(this, generation, "Environment Object",
|
||||
() => TemporaryObject.GenerateElement("New Environment Object", Guid.NewGuid(), new List<string>(),
|
||||
true, this));
|
||||
}
|
||||
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
|
||||
this.transform.eulerAngles = Vector3.zero;
|
||||
if (trackPositioner != null && trackPositioner.motion != null)
|
||||
trackPositioner.motion.applyRotation = MotionAngles;
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
@@ -116,6 +133,7 @@ namespace Ichni.RhythmGame
|
||||
public class TrackPercentPoint_BM : GameElement_BM
|
||||
{
|
||||
public FlexibleFloat_BM trackPercent;
|
||||
public bool MotionAngles = false;
|
||||
|
||||
public TrackPercentPoint_BM()
|
||||
{
|
||||
@@ -131,14 +149,26 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = TrackPercentPoint.GenerateElement(elementName, elementGuid, tags, false,
|
||||
var element = TrackPercentPoint.GenerateElement(elementName, elementGuid, tags, false,
|
||||
GetElement(attachedElementGuid) as Track, trackPercent.ConvertToGameType());
|
||||
matchedElement = element;
|
||||
// 还原MotionAngles
|
||||
if (element is TrackPercentPoint tpp && this != null)
|
||||
{
|
||||
tpp.MotionAngles = this.MotionAngles;
|
||||
}
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
return TrackPercentPoint.GenerateElement(elementName, Guid.NewGuid(), tags, false, parent as Track,
|
||||
trackPercent.ConvertToGameType());
|
||||
var newElement = TrackPercentPoint.GenerateElement(elementName, Guid.NewGuid(), tags, false,
|
||||
parent as Track, trackPercent.ConvertToGameType());
|
||||
// 复制MotionAngles
|
||||
if (newElement is TrackPercentPoint tpp)
|
||||
{
|
||||
tpp.MotionAngles = this.MotionAngles;
|
||||
}
|
||||
return newElement;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user