Hold初步
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public abstract class NoteHoldingEffect : NoteEffectBase
|
||||
{
|
||||
public float GetHoldingTime()
|
||||
{
|
||||
return (note as Hold).holdEndTime - note.exactJudgeTime;
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public abstract class NoteHoldingEffect_BM : NoteEffectBase_BM
|
||||
{
|
||||
public NoteHoldingEffect_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public NoteHoldingEffect_BM(float effectTime) : base(effectTime)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a695f1bbdfb424c83a69e14cc40aad85
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -18,7 +18,7 @@ namespace Ichni.RhythmGame
|
||||
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.tapNote, parentElement.transform)
|
||||
Hold hold = Instantiate(EditorManager.instance.basePrefabs.holdNote, parentElement.transform)
|
||||
.GetComponent<Hold>();
|
||||
hold.Initialize(elementName, id, tags, isFirstGenerated, parentElement);
|
||||
hold.exactJudgeTime = exactJudgeTime;
|
||||
@@ -29,7 +29,7 @@ namespace Ichni.RhythmGame
|
||||
if (track.trackTimeSubmodule != null)
|
||||
{
|
||||
hold.track = track;
|
||||
//hold.trackPositioner = hold.AddComponent<SplinePositioner>();
|
||||
hold.trackPositioner = hold.AddComponent<SplinePositioner>();
|
||||
hold.trackPositioner.spline = track.trackPathSubmodule.path;
|
||||
hold.isOnTrack = true;
|
||||
hold.UpdateNoteInTrack();
|
||||
@@ -61,8 +61,18 @@ namespace Ichni.RhythmGame
|
||||
base.SetUpInspector();
|
||||
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
|
||||
var container = inspector.GenerateContainer("Hold");
|
||||
|
||||
var holdEndTimeInputField = inspector.GenerateInputField(this, container, "holdEndTime", nameof(holdEndTime));
|
||||
holdEndTimeInputField.AddListenerFunction(_ =>
|
||||
{
|
||||
noteVisual?.effectSubmodule.effectCollection["Holding"].ForEach(effect =>
|
||||
{
|
||||
effect.effectTime = holdEndTime - exactJudgeTime;
|
||||
});
|
||||
});
|
||||
|
||||
var generateNoteVisualButton = inspector.GenerateButton(this, container, "Generate Note Visual", () =>
|
||||
{
|
||||
TemporaryObject.GenerateElement("New Note Visual", Guid.NewGuid(), new List<string>(), true, this);
|
||||
@@ -126,23 +136,22 @@ namespace Ichni.RhythmGame
|
||||
if (noteVisual != null)
|
||||
{
|
||||
noteVisual.effectSubmodule.effectCollection["Generate"].ForEach(e => e.UpdateEffect(exactJudgeTime));
|
||||
noteVisual.effectSubmodule.effectCollection["GeneralJudge"].ForEach(e => e.UpdateEffect(exactJudgeTime));
|
||||
|
||||
noteVisual.effectSubmodule.effectCollection["GeneralJudge"].ForEach(e => e.UpdateEffect(holdEndTime));
|
||||
noteVisual.effectSubmodule.effectCollection["Holding"].ForEach(e => e.UpdateEffect(exactJudgeTime));
|
||||
|
||||
switch (EditorManager.instance.currentJudgeType)
|
||||
{
|
||||
case NoteJudgeType.Perfect:
|
||||
noteVisual.effectSubmodule.effectCollection["Perfect"].ForEach(e => e.UpdateEffect(exactJudgeTime));
|
||||
noteVisual.effectSubmodule.effectCollection["Perfect"].ForEach(e => e.UpdateEffect(holdEndTime));
|
||||
break;
|
||||
case NoteJudgeType.Good:
|
||||
noteVisual.effectSubmodule.effectCollection["Good"].ForEach(e => e.UpdateEffect(exactJudgeTime));
|
||||
noteVisual.effectSubmodule.effectCollection["Good"].ForEach(e => e.UpdateEffect(holdEndTime));
|
||||
break;
|
||||
case NoteJudgeType.Bad:
|
||||
noteVisual.effectSubmodule.effectCollection["Bad"].ForEach(e => e.UpdateEffect(exactJudgeTime));
|
||||
noteVisual.effectSubmodule.effectCollection["Bad"].ForEach(e => e.UpdateEffect(holdEndTime));
|
||||
break;
|
||||
case NoteJudgeType.Miss:
|
||||
noteVisual.effectSubmodule.effectCollection["Miss"].ForEach(e => e.UpdateEffect(exactJudgeTime));
|
||||
noteVisual.effectSubmodule.effectCollection["Miss"].ForEach(e => e.UpdateEffect(holdEndTime));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Ichni.RhythmGame
|
||||
trackPositioner.SetPercent(1 - percent);
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
noteJudgeSubmodule = new NoteJudgeSubmodule(this);
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public EffectSubmodule effectSubmodule { get; set; }
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
base.SetDefaultSubmodules();
|
||||
effectSubmodule = new EffectSubmodule(this, EffectSubmodule.EffectSubmodulePreset.Note);
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame;
|
||||
using UnityEngine;
|
||||
|
||||
public class NoteVisualBaseHold : MonoBehaviour
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
public class NoteVisualBaseHold : NoteVisualBase
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user