Merge branch 'main' of https://github.com/MiracleForest-Ichni/IchniCreatorStudio
This commit is contained in:
@@ -34,6 +34,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
effectSubmodule.effectCollection["Prior"].ForEach(effect => effect.UpdateEffect(time));
|
||||
effectSubmodule.effectCollection["Default"].ForEach(effect => effect.UpdateEffect(time));
|
||||
effectSubmodule.effectCollection["Late"].ForEach(effect => effect.UpdateEffect(time));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Ichni.RhythmGame
|
||||
private static Dictionary<string, NoteJudgeUnit> JudgeUnitCollection(NoteBase note) =>
|
||||
new Dictionary<string, NoteJudgeUnit>()
|
||||
{
|
||||
{ "TouchArea", new TouchAreaJudgeUnit(note, 500) },
|
||||
{ "TouchArea", new TouchAreaJudgeUnit(note, 600) },
|
||||
{ "FullScreenNearTime", new FullScreenNearTimeJudgeUnit(note) },
|
||||
{ "TriggerConnect", new TriggerConnectJudgeUnit(note, null) }
|
||||
};
|
||||
|
||||
@@ -172,6 +172,7 @@ namespace Ichni.RhythmGame
|
||||
isHolding = false;
|
||||
isFinalJudged = false;
|
||||
holdingTime = 0;
|
||||
noteAudioSubmodule.PlayHoldStartAudio();
|
||||
}
|
||||
|
||||
if (isHolding)
|
||||
@@ -231,7 +232,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
if (EditorManager.instance.cameraManager.haveGameCamera)
|
||||
{
|
||||
noteScreenPosition = EditorManager.instance.cameraManager.gameCamera.gameCamera.WorldToScreenPoint(noteVisual.transform.position);
|
||||
noteScreenPosition = EditorManager.instance.cameraManager.gameCamera.gameCamera.WorldToScreenPoint(noteVisual.noteVisualPosition);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,12 +114,21 @@ namespace Ichni.RhythmGame
|
||||
UpdateEffectList(effects["Generate"]);
|
||||
UpdateEffectList(effects["GeneralJudge"]);
|
||||
|
||||
switch (editor.currentJudgeType)
|
||||
if (editor.currentJudgeType == NoteJudgeType.Perfect)
|
||||
{
|
||||
case NoteJudgeType.Perfect: UpdateEffectList(effects["Perfect"]); break;
|
||||
case NoteJudgeType.Good: UpdateEffectList(effects["Good"]); break;
|
||||
case NoteJudgeType.Bad: UpdateEffectList(effects["Bad"]); break;
|
||||
case NoteJudgeType.Miss: UpdateEffectList(effects["Miss"]); break;
|
||||
UpdateEffectList(effects["Perfect"]);
|
||||
}
|
||||
else if (editor.currentJudgeType == NoteJudgeType.Good)
|
||||
{
|
||||
UpdateEffectList(this is Tap or Hold ? effects["Good"] : effects["Perfect"]);
|
||||
}
|
||||
else if (editor.currentJudgeType == NoteJudgeType.Bad)
|
||||
{
|
||||
UpdateEffectList(this is Tap or Hold ? effects["Bad"] : effects["Perfect"]);
|
||||
}
|
||||
else if (editor.currentJudgeType == NoteJudgeType.Miss)
|
||||
{
|
||||
UpdateEffectList(effects["Miss"]);
|
||||
}
|
||||
|
||||
UpdateEffectList(effects["AfterJudge"]);
|
||||
@@ -127,8 +136,7 @@ namespace Ichni.RhythmGame
|
||||
// 屏幕位置更新(降低频率)
|
||||
if (cameraManager.haveGameCamera)//&& Time.frameCount % 3 == 0)
|
||||
{
|
||||
noteScreenPosition = cameraManager.gameCamera.gameCamera.WorldToScreenPoint(
|
||||
noteVisual.transform.position);
|
||||
noteScreenPosition = cameraManager.gameCamera.gameCamera.WorldToScreenPoint(noteVisual.noteVisualPosition);
|
||||
}
|
||||
|
||||
// 碰撞体状态
|
||||
|
||||
@@ -19,6 +19,8 @@ namespace Ichni.RhythmGame
|
||||
public List<GameObject> notePartList;
|
||||
public List<GameObject> effectPrefabList;
|
||||
|
||||
public virtual Vector3 noteVisualPosition => noteMain.transform.position;
|
||||
|
||||
public EffectSubmodule effectSubmodule { get; set; }
|
||||
public SelectSubmodule selectSubmodule { get; set; }
|
||||
|
||||
|
||||
@@ -119,6 +119,12 @@ namespace Ichni.RhythmGame
|
||||
var isShowingSphereToggle =
|
||||
inspector.GenerateToggle(this, pathNodeSettings, "Is Showing Sphere", nameof(isShowingSphere))
|
||||
.AddListenerFunction(() => SetPathNodeSphere(isShowingSphere));
|
||||
|
||||
var generateAnimation = container.GenerateSubcontainer(3);
|
||||
StandardInspectionElement.GenerateForTransform(this, container);
|
||||
var generateBaseColorChangeButton = inspector.GenerateButton(this, generateAnimation, "Base Color Change",
|
||||
() => BaseColorChange.GenerateElement("New Base Color Change", Guid.NewGuid(), new List<string>(), true,
|
||||
this, new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,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, false); }); //头部点(必须先有TrackTimeSubmoduleMovable)
|
||||
() => { TrackHeadPoint.GenerateElement("New Track Head Point", Guid.NewGuid(), new List<string>(), true, this, false, Vector3.zero); }); //头部点(必须先有TrackTimeSubmoduleMovable)
|
||||
if (trackTimeSubmodule is not TrackTimeSubmoduleMovable) trackHeadPointButton.button.interactable = false;
|
||||
|
||||
var noteSubcontainer = generateContainer.GenerateSubcontainer(3);
|
||||
|
||||
@@ -18,23 +18,24 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public TimeDurationSubmodule timeDurationSubmodule { get; set; }
|
||||
public bool motionApplyRotation;
|
||||
|
||||
public Vector3 motionEulerAngles;
|
||||
private float SongTime => EditorManager.instance.songInformation.songTime;
|
||||
|
||||
public static TrackHeadPoint GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
bool isFirstGenerated, Track track, bool motionApplyRotation)
|
||||
bool isFirstGenerated, Track track, bool motionApplyRotation, Vector3 motionEulerAngles)
|
||||
{
|
||||
TrackHeadPoint head = Instantiate(EditorManager.instance.basePrefabs.emptyObject, track.transform)
|
||||
.AddComponent<TrackHeadPoint>();
|
||||
TrackHeadPoint head = Instantiate(EditorManager.instance.basePrefabs.emptyObject, track.transform).AddComponent<TrackHeadPoint>();
|
||||
|
||||
head.Initialize(elementName, id, tags, isFirstGenerated, track);
|
||||
head.track = track;
|
||||
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;
|
||||
head.motionEulerAngles = motionEulerAngles;
|
||||
head.trackPositioner.motion.rotationOffset = motionEulerAngles;
|
||||
|
||||
return head;
|
||||
}
|
||||
@@ -58,7 +59,8 @@ namespace Ichni.RhythmGame
|
||||
public override void SaveBM()
|
||||
{
|
||||
// 保存MotionAngles到BM
|
||||
matchedBM = new TrackHeadPoint_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM, motionApplyRotation);
|
||||
matchedBM = new TrackHeadPoint_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM,
|
||||
motionApplyRotation, motionEulerAngles);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
@@ -67,9 +69,13 @@ 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(motionApplyRotation));
|
||||
|
||||
var motionAngles0 = container.GenerateSubcontainer(3);
|
||||
var motionAnglesApplyToggle = inspector.GenerateToggle(this, motionAngles0, "Motion With Angles", nameof(motionApplyRotation))
|
||||
.AddListenerFunction(() => trackPositioner.motion.applyRotation = motionApplyRotation);
|
||||
var motionAngles1 = container.GenerateSubcontainer(1);
|
||||
var motionAnglesValueInputField = inspector.GenerateVector3InputField(this, motionAngles1, "Motion Angles", nameof(motionEulerAngles))
|
||||
.AddListenerFunction(()=> trackPositioner.motion.rotationOffset = motionEulerAngles);
|
||||
|
||||
var generation = container.GenerateSubcontainer(3);
|
||||
var generateTrailButton = inspector.GenerateButton(this, generation, "Generate Trail", () =>
|
||||
{
|
||||
@@ -81,12 +87,6 @@ namespace Ichni.RhythmGame
|
||||
() => TemporaryObject.GenerateElement("New Environment Object", Guid.NewGuid(), new List<string>(),
|
||||
true, this));
|
||||
}
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
trackPositioner.motion.applyRotation = motionApplyRotation;
|
||||
this.transform.localEulerAngles = Vector3.zero;
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
@@ -95,6 +95,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
// 新增属性
|
||||
public bool motionApplyRotation = false;
|
||||
public Vector3 motionEulerAngles = Vector3.zero;
|
||||
|
||||
public TrackHeadPoint_BM()
|
||||
{
|
||||
@@ -102,24 +103,23 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
|
||||
public TrackHeadPoint_BM(string elementName, Guid elementGuid, List<string> tags,
|
||||
GameElement_BM attachedElement, bool motionApplyRotation)
|
||||
GameElement_BM attachedElement, bool motionApplyRotation, Vector3 motionEulerAngles)
|
||||
: base(elementName, elementGuid, tags, attachedElement)
|
||||
{
|
||||
this.motionApplyRotation = motionApplyRotation;
|
||||
this.motionEulerAngles = motionEulerAngles;
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
var element = TrackHeadPoint.GenerateElement(elementName, elementGuid, tags, false,
|
||||
GetElement(attachedElementGuid) as Track, motionApplyRotation);
|
||||
matchedElement = element;
|
||||
matchedElement = TrackHeadPoint.GenerateElement(elementName, elementGuid, tags, false,
|
||||
GetElement(attachedElementGuid) as Track, motionApplyRotation, motionEulerAngles);
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
var newElement = TrackHeadPoint.GenerateElement(elementName, Guid.NewGuid(), tags,
|
||||
false, parent as Track, motionApplyRotation);
|
||||
return newElement;
|
||||
return TrackHeadPoint.GenerateElement(elementName, Guid.NewGuid(), tags,
|
||||
false, parent as Track, motionApplyRotation, motionEulerAngles);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -475,7 +475,7 @@ namespace Ichni
|
||||
private void SaveBeatMap(string autoSavePath)
|
||||
{
|
||||
EditorManager.instance.beatmapContainer.SaveBM();
|
||||
ES3.Save("BeatMap", EditorManager.instance.beatmapContainer.matchedBM as BeatmapContainer_BM,
|
||||
ES3.Save("Beatmap", EditorManager.instance.beatmapContainer.matchedBM as BeatmapContainer_BM,
|
||||
autoSavePath, ProjectManager.SaveSettings);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user