重写NoteManager
This commit is contained in:
@@ -49,10 +49,10 @@ MonoBehaviour:
|
||||
m_addressable:
|
||||
m_atlas:
|
||||
m_fileSize: 26776
|
||||
m_assetChangeTS: 1759462517
|
||||
m_fileInfoReadTS: 1759462518
|
||||
m_fileWriteTS: 1759462517
|
||||
m_cachefileWriteTS: 1759462517
|
||||
m_assetChangeTS: 1759488204
|
||||
m_fileInfoReadTS: 1759488205
|
||||
m_fileWriteTS: 1759488204
|
||||
m_cachefileWriteTS: 1759488204
|
||||
refreshStamp: 3
|
||||
UseGUIDsList:
|
||||
- guid: cd62869af1bc6534d83427c72b66bb9f
|
||||
@@ -21597,15 +21597,15 @@ MonoBehaviour:
|
||||
UseGUIDsList: []
|
||||
- guid: 81e2cda70e8084a3fb324d644db244fd
|
||||
type: 5
|
||||
m_fileInfoHash: 334869.asset
|
||||
m_fileInfoHash: 334247.asset
|
||||
m_assetbundle:
|
||||
m_addressable:
|
||||
m_atlas:
|
||||
m_fileSize: 334869
|
||||
m_assetChangeTS: 1759313051
|
||||
m_fileInfoReadTS: 1759313055
|
||||
m_fileWriteTS: 1759313050
|
||||
m_cachefileWriteTS: 1759313050
|
||||
m_fileSize: 334247
|
||||
m_assetChangeTS: 1759488204
|
||||
m_fileInfoReadTS: 1759488205
|
||||
m_fileWriteTS: 1759488204
|
||||
m_cachefileWriteTS: 1759488204
|
||||
refreshStamp: 3
|
||||
UseGUIDsList:
|
||||
- guid: e6b16dc7c203450459bb86e24305f9ca
|
||||
@@ -22704,28 +22704,14 @@ MonoBehaviour:
|
||||
ids: 73000000
|
||||
- guid: ccf1aba9553839d41ae37dd52e9ebcce
|
||||
ids: 73000000
|
||||
- guid: 188dfe7e559f13248ba2c41eb5a59328
|
||||
ids: 1c000000
|
||||
- guid: f20112bdeec2e8d4d9f80e8390e37263
|
||||
ids: 1c000000
|
||||
- guid: f66c4aa44c09b6a42a2b5b9f9334d824
|
||||
ids: 1c000000
|
||||
- guid: 3ee40aa79cd242a5b53b0b0ca4f13f0f
|
||||
ids: 1c000000
|
||||
- guid: a7ec9e7ad8b847b7ae4510af83c5d868
|
||||
ids: 1c000000
|
||||
- guid: b0f85f7da5042c0448a526d5ecacbfa9
|
||||
ids: 1c000000
|
||||
- guid: c78150f2237d29247b0f01c770f06979
|
||||
ids: 1c000000
|
||||
- guid: dcc0ed9263c0d524aabeb5f4bd75ecee
|
||||
ids: 1c000000
|
||||
- guid: 93f09189124b21e479fc891dbc1b93bf
|
||||
ids: 1c000000
|
||||
- guid: 38ac935dd3d70c04c9b8eb4d1b8b034b
|
||||
ids: 30000000
|
||||
- guid: fea416d728e272045b75d7ad31dd623f
|
||||
ids: 15000000
|
||||
- guid: ee148e281f3c41c5b4ff5f8a5afe5a6c
|
||||
ids: 1c000000
|
||||
- guid: 6fe401fc051728b49a4e682f518ffc54
|
||||
ids: 73000000
|
||||
- guid: 8113366f9f7cec647878e3af2fb98922
|
||||
type: 9
|
||||
m_fileInfoHash: 19671.png
|
||||
@@ -77804,15 +77790,15 @@ MonoBehaviour:
|
||||
UseGUIDsList: []
|
||||
- guid: 95d3a881bc3654f05ba69138e8c703cb
|
||||
type: 2
|
||||
m_fileInfoHash: 11093.cs
|
||||
m_fileInfoHash: 12862.cs
|
||||
m_assetbundle:
|
||||
m_addressable:
|
||||
m_atlas:
|
||||
m_fileSize: 11093
|
||||
m_assetChangeTS: 1755714598
|
||||
m_fileInfoReadTS: 1755714604
|
||||
m_fileWriteTS: 1754304030
|
||||
m_cachefileWriteTS: 1754304030
|
||||
m_fileSize: 12862
|
||||
m_assetChangeTS: 1759488168
|
||||
m_fileInfoReadTS: 1759488175
|
||||
m_fileWriteTS: 1759488159
|
||||
m_cachefileWriteTS: 1759488159
|
||||
refreshStamp: 3
|
||||
UseGUIDsList: []
|
||||
- guid: 95140e49213aa6f49a470a81873b87c0
|
||||
@@ -132667,15 +132653,15 @@ MonoBehaviour:
|
||||
UseGUIDsList: []
|
||||
- guid: 99c9720ab356a0642a771bea13969a05
|
||||
type: 3
|
||||
m_fileInfoHash: 1129176.unity
|
||||
m_fileInfoHash: 1129028.unity
|
||||
m_assetbundle:
|
||||
m_addressable:
|
||||
m_atlas:
|
||||
m_fileSize: 1129176
|
||||
m_assetChangeTS: 1759313051
|
||||
m_fileInfoReadTS: 1759313055
|
||||
m_fileWriteTS: 1759313051
|
||||
m_cachefileWriteTS: 1759313051
|
||||
m_fileSize: 1129028
|
||||
m_assetChangeTS: 1759488204
|
||||
m_fileInfoReadTS: 1759488205
|
||||
m_fileWriteTS: 1759488204
|
||||
m_cachefileWriteTS: 1759488204
|
||||
refreshStamp: 3
|
||||
UseGUIDsList:
|
||||
- guid: 86dabb0c8cddcb741a5690ed143e3fb2
|
||||
@@ -132816,6 +132802,8 @@ MonoBehaviour:
|
||||
ids: 73000000
|
||||
- guid: 5ce536c50a1fc2c4c9a143590a1695b7
|
||||
ids: 73000000
|
||||
- guid: 6fe401fc051728b49a4e682f518ffc54
|
||||
ids: 73000000
|
||||
- guid: 31a19414c41e5ae4aae2af33fee712f6
|
||||
ids: 73000000
|
||||
- guid: 5e16c7aea118d68498053518146c9cf9
|
||||
@@ -133910,23 +133898,11 @@ MonoBehaviour:
|
||||
ids: d50000001c000000
|
||||
- guid: 221518ef91623a7438a71fef23660601
|
||||
ids: 73000000
|
||||
- guid: b0f85f7da5042c0448a526d5ecacbfa9
|
||||
ids: 1c000000
|
||||
- guid: 3ee40aa79cd242a5b53b0b0ca4f13f0f
|
||||
ids: 1c000000
|
||||
- guid: c78150f2237d29247b0f01c770f06979
|
||||
ids: 1c000000
|
||||
- guid: 38ac935dd3d70c04c9b8eb4d1b8b034b
|
||||
ids: 30000000
|
||||
- guid: a7ec9e7ad8b847b7ae4510af83c5d868
|
||||
ids: 1c000000
|
||||
- guid: f66c4aa44c09b6a42a2b5b9f9334d824
|
||||
ids: 1c000000
|
||||
- guid: fea416d728e272045b75d7ad31dd623f
|
||||
ids: 15000000
|
||||
- guid: f20112bdeec2e8d4d9f80e8390e37263
|
||||
ids: 1c000000
|
||||
- guid: 188dfe7e559f13248ba2c41eb5a59328
|
||||
- guid: ee148e281f3c41c5b4ff5f8a5afe5a6c
|
||||
ids: 1c000000
|
||||
- guid: 991ae4d843392bc4e9ec4e7d8649d94e
|
||||
type: 2
|
||||
@@ -172920,21 +172896,23 @@ MonoBehaviour:
|
||||
UseGUIDsList: []
|
||||
- guid: 7c10da0d74d78364bac94506d77290bf
|
||||
type: 5
|
||||
m_fileInfoHash: 2759.mat
|
||||
m_fileInfoHash: 2814.mat
|
||||
m_assetbundle:
|
||||
m_addressable:
|
||||
m_atlas:
|
||||
m_fileSize: 2759
|
||||
m_assetChangeTS: 1759462517
|
||||
m_fileInfoReadTS: 1759462518
|
||||
m_fileWriteTS: 1759462517
|
||||
m_cachefileWriteTS: 1759462517
|
||||
m_fileSize: 2814
|
||||
m_assetChangeTS: 1759488204
|
||||
m_fileInfoReadTS: 1759488205
|
||||
m_fileWriteTS: 1759488204
|
||||
m_cachefileWriteTS: 1759488204
|
||||
refreshStamp: 3
|
||||
UseGUIDsList:
|
||||
- guid: 06e8da9b2b26f09459e8a93e84b2e0c9
|
||||
ids: 30000000
|
||||
- guid: f7cb012c92543074491a665c761d51dc
|
||||
ids: 59000000
|
||||
- guid: 7ba462c2dc80b544eacfdc537aab22c6
|
||||
ids: 59000000
|
||||
- guid: 7ca043dc9da4b1e49a30103f3e9a5fa8
|
||||
type: 2
|
||||
m_fileInfoHash: 7039.cs
|
||||
@@ -181922,15 +181900,15 @@ MonoBehaviour:
|
||||
UseGUIDsList: []
|
||||
- guid: 1d40f46869fc84408ab4870b70e789ef
|
||||
type: 2
|
||||
m_fileInfoHash: 9256.cs
|
||||
m_fileInfoHash: 9297.cs
|
||||
m_assetbundle:
|
||||
m_addressable:
|
||||
m_atlas:
|
||||
m_fileSize: 9256
|
||||
m_assetChangeTS: 1759313008
|
||||
m_fileInfoReadTS: 1759313026
|
||||
m_fileWriteTS: 1759312873
|
||||
m_cachefileWriteTS: 1759312873
|
||||
m_fileSize: 9297
|
||||
m_assetChangeTS: 1759488168
|
||||
m_fileInfoReadTS: 1759488175
|
||||
m_fileWriteTS: 1759487752
|
||||
m_cachefileWriteTS: 1759487752
|
||||
refreshStamp: 3
|
||||
UseGUIDsList: []
|
||||
- guid: 1d50f0545bfd1304eace331e06cb2cc2
|
||||
@@ -226813,6 +226791,19 @@ MonoBehaviour:
|
||||
m_cachefileWriteTS: 1759461301
|
||||
refreshStamp: 3
|
||||
UseGUIDsList: []
|
||||
- guid: 6fe401fc051728b49a4e682f518ffc54
|
||||
type: 2
|
||||
m_fileInfoHash: 1341.cs
|
||||
m_assetbundle:
|
||||
m_addressable:
|
||||
m_atlas:
|
||||
m_fileSize: 1341
|
||||
m_assetChangeTS: 1759488168
|
||||
m_fileInfoReadTS: 1759488175
|
||||
m_fileWriteTS: 1759487987
|
||||
m_cachefileWriteTS: 1759487987
|
||||
refreshStamp: 3
|
||||
UseGUIDsList: []
|
||||
setting:
|
||||
alternateColor: 1
|
||||
excludeTypes: 0
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -33,6 +33,46 @@ namespace Ichni.RhythmGame
|
||||
[FormerlySerializedAs("isJudged")] public bool isFirstJudged;
|
||||
public override int HierarchyPriority => -10;
|
||||
|
||||
public override void AfterInitialize()
|
||||
{
|
||||
base.AfterInitialize();
|
||||
|
||||
float beyondTime = 0f;
|
||||
|
||||
foreach (EffectBase effectBase in noteVisual.effectSubmodule.effectCollection["Generate"])
|
||||
{
|
||||
if (effectBase is NoteGenerateEffect ge)
|
||||
{
|
||||
ge.Recover();
|
||||
beyondTime = Mathf.Max(beyondTime, ge.generateTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
effectBase.Recover();
|
||||
}
|
||||
}
|
||||
|
||||
float finishTime = 0f;
|
||||
List<EffectBase> finishEffects = new List<EffectBase>();
|
||||
finishEffects.AddRange(noteVisual.effectSubmodule.effectCollection["GeneralJudge"]);
|
||||
finishEffects.AddRange(noteVisual.effectSubmodule.effectCollection["Perfect"]);
|
||||
finishEffects.AddRange(noteVisual.effectSubmodule.effectCollection["Good"]);
|
||||
finishEffects.AddRange(noteVisual.effectSubmodule.effectCollection["Bad"]);
|
||||
finishEffects.AddRange(noteVisual.effectSubmodule.effectCollection["Miss"]);
|
||||
|
||||
foreach (EffectBase effectBase in finishEffects)
|
||||
{
|
||||
finishTime = Mathf.Max(finishTime, effectBase.effectTime);
|
||||
}
|
||||
|
||||
if (exactJudgeTime - beyondTime - 0.5f > -EditorManager.instance.songInformation.delay)
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
EditorManager.instance.noteManager.RegisterNote(this, exactJudgeTime - beyondTime - 0.5f, exactJudgeTime + finishTime + 1.5f);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 在MovableTrack上更新Note的位置,注意HoldNote需要重写这个方法
|
||||
/// </summary>
|
||||
@@ -75,6 +115,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
foreach (SampleWindow i in SampleWindow.instances.Where(i => i.gameElement)) i.OnceSpawnNote();
|
||||
}
|
||||
|
||||
protected virtual void Update()
|
||||
{
|
||||
var editor = EditorManager.instance;
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace Ichni
|
||||
public BackgroundController backgroundController;
|
||||
public GridController gridController;
|
||||
public CameraManager cameraManager;
|
||||
public NoteManager noteManager;
|
||||
public Ichni.Editor.PostProcessingManager postProcessingManager;
|
||||
public Canvas judgeHintCanvas;
|
||||
public Canvas inspectorCanvas;
|
||||
|
||||
39
Assets/Scripts/Manager/NoteManager.cs
Normal file
39
Assets/Scripts/Manager/NoteManager.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public class NoteManager : MonoBehaviour
|
||||
{
|
||||
private List<(NoteBase note, float activationTime, float finishTime)> pendingNotes = new List<(NoteBase, float, float)>();
|
||||
private int nextNoteIndex = 0;
|
||||
|
||||
public void RegisterNote(NoteBase note, float activationTime, float finishTime)
|
||||
{
|
||||
pendingNotes.Add((note, activationTime, finishTime));
|
||||
}
|
||||
|
||||
// 在所有物体注册完毕后,对列表进行一次排序
|
||||
public void AllNotesRegistered()
|
||||
{
|
||||
pendingNotes.Sort((a, b) => a.activationTime.CompareTo(b.activationTime));
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
foreach ((NoteBase note, float activationTime, float finishTime) note in pendingNotes)
|
||||
{
|
||||
if (EditorManager.instance.songInformation.songTime >= note.activationTime &&
|
||||
EditorManager.instance.songInformation.songTime <= note.finishTime)
|
||||
{
|
||||
note.note.gameObject.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
note.note.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Manager/NoteManager.cs.meta
Normal file
11
Assets/Scripts/Manager/NoteManager.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6fe401fc051728b49a4e682f518ffc54
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user