Hold初步
This commit is contained in:
@@ -15,7 +15,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public TimeDurationSubmodule timeDurationSubmodule { get; set; }
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Ichni.RhythmGame
|
||||
return baseColorChange;
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
}
|
||||
|
||||
@@ -34,8 +34,8 @@ namespace Ichni.RhythmGame
|
||||
|
||||
return emissionColorChange;
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@ namespace Ichni.RhythmGame
|
||||
|
||||
return trackTotalTimeChange;
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
}
|
||||
|
||||
@@ -37,8 +37,8 @@ namespace Ichni.RhythmGame
|
||||
|
||||
return look;
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
}
|
||||
|
||||
@@ -33,8 +33,8 @@ namespace Ichni.RhythmGame
|
||||
|
||||
return scale;
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Ichni.RhythmGame
|
||||
return swirl;
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
}
|
||||
|
||||
@@ -177,6 +177,11 @@ namespace Ichni.RhythmGame
|
||||
/// 是否是瞬间效果
|
||||
/// </summary>
|
||||
public bool isInstantEffect => effectTime <= 0;
|
||||
|
||||
/// <summary>
|
||||
/// 效果的进度百分比
|
||||
/// </summary>
|
||||
public float effectProgressPercent;
|
||||
|
||||
/// <summary>
|
||||
/// 效果当前的状态
|
||||
@@ -187,12 +192,14 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
this.effectTime = 0;
|
||||
this.nowEffectState = EffectState.Before;
|
||||
this.effectProgressPercent = 0;
|
||||
}
|
||||
|
||||
protected EffectBase(float effectTime)
|
||||
{
|
||||
this.effectTime = effectTime;
|
||||
this.nowEffectState = EffectState.Before;
|
||||
this.effectProgressPercent = 0;
|
||||
}
|
||||
|
||||
public void SaveBM()
|
||||
@@ -203,20 +210,24 @@ namespace Ichni.RhythmGame
|
||||
public virtual void UpdateEffect(float triggerTime)
|
||||
{
|
||||
EffectState state = CheckEffectState(triggerTime);
|
||||
float songTime = EditorManager.instance.songInformation.songTime;
|
||||
|
||||
if (state == EffectState.Before && nowEffectState != EffectState.Before)
|
||||
{
|
||||
nowEffectState = EffectState.Before;
|
||||
effectProgressPercent = 0;
|
||||
Recover();
|
||||
}
|
||||
else if (state == EffectState.Middle)
|
||||
{
|
||||
nowEffectState = EffectState.Middle;
|
||||
effectProgressPercent = (songTime - triggerTime) / effectTime;
|
||||
Execute();
|
||||
}
|
||||
else if (state == EffectState.After && nowEffectState != EffectState.After)
|
||||
{
|
||||
nowEffectState = EffectState.After;
|
||||
effectProgressPercent = 1;
|
||||
Adjust();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Ichni.RhythmGame
|
||||
return elementFolder;
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
transformSubmodule = new TransformSubmodule(this);
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Ichni.Editor
|
||||
EditorManager.instance.backgroundController.SetBackground(backgroundSprite);
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace Ichni.RhythmGame
|
||||
return gameCamera;
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
transformSubmodule = new TransformSubmodule(this);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace Ichni.RhythmGame
|
||||
/// <summary>
|
||||
/// 设置次级模块
|
||||
/// </summary>
|
||||
protected virtual void SetDefaultSubmodules()
|
||||
public virtual void SetDefaultSubmodules()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Ichni.RhythmGame
|
||||
return timeEffectsCollection;
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
effectSubmodule = new EffectSubmodule(this);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
transformSubmodule = new TransformSubmodule(this);
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Ichni.RhythmGame
|
||||
return pathNode;
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
transformSubmodule = new TransformSubmodule(this);
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Ichni.RhythmGame
|
||||
return track;
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
transformSubmodule = new TransformSubmodule(this);
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
@@ -161,11 +161,11 @@ namespace Ichni.RhythmGame
|
||||
Stay.GenerateElement("New Stay", Guid.NewGuid(), new List<string>(), true, this, 0f);
|
||||
}); //Note Stay
|
||||
|
||||
// var holdButton = inspector.GenerateButton(this, generateContainer, "Hold",
|
||||
// () =>
|
||||
// {
|
||||
// Hold.GenerateElement("New Hold", Guid.NewGuid(), new List<string>(), true, this, 0f);
|
||||
// }); //Note Hold
|
||||
var holdButton = inspector.GenerateButton(this, generateContainer, "Hold",
|
||||
() =>
|
||||
{
|
||||
Hold.GenerateElement("New Hold", Guid.NewGuid(), new List<string>(), true, this, 0f, 1f);
|
||||
}); //Note Hold
|
||||
|
||||
var flickButton = inspector.GenerateButton(this, generateContainer, "Flick",
|
||||
() =>
|
||||
@@ -208,8 +208,7 @@ namespace Ichni.RhythmGame
|
||||
trackRendererAutoOrientButton.button.interactable = false;
|
||||
trackRendererPathGeneratorButton.button.interactable = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var toolsContainerTrack = inspector.GenerateContainer("Track Tools"); //轨道(整体)快捷工具
|
||||
var quickCopyButton = inspector.GenerateButton(this, toolsContainerTrack, "QuickCopy", () =>
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Ichni.RhythmGame
|
||||
return point;
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Ichni.RhythmGame
|
||||
return head;
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Ichni.RhythmGame
|
||||
return point;
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Ichni.RhythmGame
|
||||
return trail;
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
public override void SetDefaultSubmodules()
|
||||
{
|
||||
transformSubmodule = new TransformSubmodule(this);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor.SearchService;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
@@ -10,7 +9,7 @@ public class FirmStartMenu : MonoBehaviour
|
||||
static void Initialize()
|
||||
{
|
||||
string startSceneName = "StartMenu";
|
||||
UnityEngine.SceneManagement.Scene scene = SceneManager.GetActiveScene();
|
||||
Scene scene = SceneManager.GetActiveScene();
|
||||
if (scene.name.Equals(startSceneName))
|
||||
{
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user