🤔
This commit is contained in:
@@ -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