🤔
This commit is contained in:
@@ -75,10 +75,27 @@ namespace Ichni.RhythmGame
|
||||
var swirlButton = inspector.GenerateButton(this, generateAnimation, "Swirl",
|
||||
() => Swirl.GenerateElement("New Swirl", Guid.NewGuid(), new List<string>(), true, this,
|
||||
new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat()));
|
||||
|
||||
|
||||
var extensionButton = inspector.GenerateButton(this, generateAnimation, "Extension",
|
||||
() => GameCameraExtension.GenerateElement("New Extension", Guid.NewGuid(),
|
||||
() => GameCameraExtension.GenerateElement("New Extension", Guid.NewGuid(),
|
||||
new List<string>(), true, this, 1000f));
|
||||
if (childElementList.Where(i => i is CameraAngleOffset).Count() == 0)
|
||||
{
|
||||
var CAOButton = inspector.GenerateButton(this, generateAnimation, "CameraAngleOffset",
|
||||
() => CameraAngleOffset.GenerateElement(
|
||||
"New CameraAngleOffset",
|
||||
Guid.NewGuid(),
|
||||
new List<string>(),
|
||||
true,
|
||||
this,
|
||||
new FlexibleBool(),
|
||||
0f,
|
||||
0f,
|
||||
0f,
|
||||
0f,
|
||||
AnimationCurveType.Linear
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,9 +134,9 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
bool willRefresh = false;
|
||||
|
||||
|
||||
if (transformSubmodule.eulerAnglesOffsetLock)
|
||||
{
|
||||
transform.localEulerAngles = transformSubmodule.originalEulerAngles;
|
||||
@@ -151,15 +168,15 @@ namespace Ichni.RhythmGame
|
||||
transformSubmodule.positionDirtyMark = false;
|
||||
willRefresh = true;
|
||||
}
|
||||
|
||||
if(willRefresh)
|
||||
|
||||
if (willRefresh)
|
||||
{
|
||||
this.Refresh();
|
||||
}
|
||||
|
||||
|
||||
transformSubmodule.eulerAnglesOffset.Clear();
|
||||
transformSubmodule.positionOffset.Clear();
|
||||
|
||||
|
||||
}).AddTo(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,22 +12,24 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public partial class Hold : NoteBase
|
||||
{
|
||||
public static List<Hold> holdingHoldList = new();
|
||||
|
||||
public float holdEndTime;
|
||||
public float holdingTime;
|
||||
public bool isHolding;
|
||||
public bool isFinalJudged;
|
||||
|
||||
|
||||
public static Hold GenerateElement(string elementName, Guid id, List<string> tags, bool isFirstGenerated,
|
||||
GameElement parentElement, float exactJudgeTime, float holdEndTime)
|
||||
{
|
||||
Hold hold = Instantiate(EditorManager.instance.basePrefabs.holdNote, parentElement.transform)
|
||||
.GetComponent<Hold>();
|
||||
|
||||
|
||||
if (EditorManager.instance.useNotePrefab)
|
||||
{
|
||||
isFirstGenerated = false;
|
||||
}
|
||||
|
||||
|
||||
hold.Initialize(elementName, id, tags, isFirstGenerated, parentElement);
|
||||
hold.exactJudgeTime = exactJudgeTime;
|
||||
hold.holdEndTime = holdEndTime;
|
||||
@@ -54,10 +56,10 @@ namespace Ichni.RhythmGame
|
||||
hold.track = null;
|
||||
hold.isOnTrack = false;
|
||||
}
|
||||
|
||||
|
||||
if (EditorManager.instance.useNotePrefab)
|
||||
{
|
||||
EditorManager.instance.projectManager.notePrefabManager.LoadNotePrefab(hold,GetNoteTypeName(hold) + "_Prefab");
|
||||
EditorManager.instance.projectManager.notePrefabManager.LoadNotePrefab(hold, GetNoteTypeName(hold) + "_Prefab");
|
||||
}
|
||||
|
||||
return hold;
|
||||
@@ -88,7 +90,7 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public partial class Hold
|
||||
{
|
||||
public override void SetDefaultSubmodules()
|
||||
@@ -105,9 +107,9 @@ namespace Ichni.RhythmGame
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
base.SetUpInspector();
|
||||
|
||||
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
|
||||
|
||||
var holdSpecial = inspector.GenerateContainer("Hold");
|
||||
var holdSpecialSubcontainer = holdSpecial.GenerateSubcontainer(3);
|
||||
var holdEndTimeInputField = inspector.GenerateInputField(this, holdSpecialSubcontainer, "holdEndTime", nameof(holdEndTime));
|
||||
@@ -118,7 +120,7 @@ namespace Ichni.RhythmGame
|
||||
effect.effectTime = holdEndTime - exactJudgeTime;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
inspector.MarkedElements["ExactJudgeTime"].AddListenerFunction(() =>
|
||||
{
|
||||
noteVisual?.effectSubmodule.effectCollection["Holding"].ForEach(effect =>
|
||||
@@ -133,12 +135,12 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
protected override void Update()
|
||||
{
|
||||
if(holdEndTime < exactJudgeTime)
|
||||
if (holdEndTime < exactJudgeTime)
|
||||
{
|
||||
LogWindow.Log("Hold end time is earlier than exact judge time.", Color.red);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*if (isOnTrack)
|
||||
{
|
||||
UpdateNoteInTrack();
|
||||
@@ -148,22 +150,23 @@ namespace Ichni.RhythmGame
|
||||
|
||||
if (isFirstJudged && songTime < exactJudgeTime)
|
||||
{
|
||||
|
||||
isFirstJudged = false;
|
||||
isHolding = false;
|
||||
isFinalJudged = false;
|
||||
holdingTime = 0;
|
||||
}
|
||||
|
||||
|
||||
if (isHolding)
|
||||
{
|
||||
holdingTime = songTime - exactJudgeTime;
|
||||
}
|
||||
|
||||
|
||||
if (isHolding && songTime > holdEndTime)
|
||||
{
|
||||
isHolding = false;
|
||||
isFinalJudged = true;
|
||||
noteAudioSubmodule.PlayNoteJudgeAudios(EditorManager.instance.currentJudgeType);
|
||||
noteAudioSubmodule?.PlayNoteJudgeAudios(EditorManager.instance.currentJudgeType);
|
||||
}
|
||||
|
||||
if (!isFirstJudged && songTime >= exactJudgeTime)
|
||||
@@ -214,8 +217,16 @@ namespace Ichni.RhythmGame
|
||||
noteScreenPosition = EditorManager.instance.cameraManager.gameCamera.gameCamera.WorldToScreenPoint(noteVisual.transform.position);
|
||||
}
|
||||
}
|
||||
if (isHolding && !holdingHoldList.Contains(this))
|
||||
{
|
||||
holdingHoldList.Add(this);
|
||||
}
|
||||
else if (!isHolding && holdingHoldList.Contains(this))
|
||||
{
|
||||
holdingHoldList.Remove(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
if (isOnTrack)
|
||||
@@ -230,7 +241,7 @@ namespace Ichni.RhythmGame
|
||||
public class Hold_BM : NoteBase_BM
|
||||
{
|
||||
public float holdEndTime;
|
||||
|
||||
|
||||
public Hold_BM()
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user