musicplayer改

Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
2025-08-23 23:18:29 +08:00
parent e4ffc1fd64
commit 84ff356427
34 changed files with 108215 additions and 337568 deletions

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 0d013f5aeb1e0f641a04f18227d4af14 guid: 459a7ea4ef65c664482b6377848ac5c3
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: d2972cff12df25746a233fd562ecade2 guid: 6dbdd314784e80440b48088e6357c1ef
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@@ -105,7 +105,8 @@ namespace Ichni.Editor
} }
// 使用 DOTween 来平滑过渡到新的时间 // 使用 DOTween 来平滑过渡到新的时间
_activeTweener = DOTween.To(() => EditorManager.instance.songInformation.songTime, x => EditorManager.instance.songInformation.songTime = x, parsedTime, 0.2f) _activeTweener = DOTween.To(() => EditorManager.instance.songInformation.songTime, x => EditorManager.instance.songInformation.songTime = x, parsedTime, 0.2f)
.OnUpdate(UpdateTime); .OnUpdate(UpdateTime)
;
// timePointerModule.UpdatePointers(); // timePointerModule.UpdatePointers();
// timePointerModule.SetRange(songTime); // timePointerModule.SetRange(songTime);

View File

@@ -32,7 +32,7 @@ namespace Ichni.RhythmGame
public float trackTotalTime; public float trackTotalTime;
public float visibleTrackTimeLength; public float visibleTrackTimeLength;
public AnimationCurveType animationCurveType; public AnimationCurveType animationCurveType;
//public bool isGoWithZ = false;
public TrackTimeSubmoduleMovable(Track track, float trackStartTime, float trackEndTime, public TrackTimeSubmoduleMovable(Track track, float trackStartTime, float trackEndTime,
float visibleTrackTimeLength, AnimationCurveType animationCurveType) : base(track) float visibleTrackTimeLength, AnimationCurveType animationCurveType) : base(track)
{ {
@@ -61,8 +61,44 @@ namespace Ichni.RhythmGame
public float GetTrackPercent(float songTimeInTime) public float GetTrackPercent(float songTimeInTime)
{ {
float per = AnimationCurveEvaluator.Evaluate(animationCurveType, (songTimeInTime - trackStartTime) / trackTotalTime); float per = AnimationCurveEvaluator.Evaluate(animationCurveType, (songTimeInTime - trackStartTime) / trackTotalTime);
// return isGoWithZ ? GetSplineZPercent(Mathf.Clamp01(per)) : Mathf.Clamp01(per);
return Mathf.Clamp01(per); return Mathf.Clamp01(per);
} }
// private float GetSplineZPercent(float percent)
// {
// var nodeList = track.trackPathSubmodule.pathNodeList;
// int count = nodeList.Count;
// if (count <= 2) return percent;
// float startZ = nodeList[0].transformSubmodule.currentPosition.z;
// float endZ = nodeList[count - 1].transformSubmodule.currentPosition.z;
// float needZ = Mathf.Lerp(startZ, endZ, percent);
// float outpercent = 0f;
// float percentBetween = 1f / (count - 1);
// for (int i = 0; i < count - 1; i++)
// {
// float z0 = nodeList[i].transformSubmodule.currentPosition.z;
// float z1 = nodeList[i + 1].transformSubmodule.currentPosition.z;
// // 如果 needZ 在当前区间内,做插值
// if ((z0 <= needZ && needZ <= z1) || (z1 <= needZ && needZ <= z0))
// {
// float zDelta = z1 - z0;
// if (Mathf.Approximately(zDelta, 0f)) return outpercent;
// float t = (needZ - z0) / zDelta;
// outpercent += percentBetween * Mathf.Clamp01(t);
// return outpercent;
// }
// else
// {
// outpercent += percentBetween;
// }
// }
// // 如果没找到区间,返回 1f已遍历所有节点
// return 1f;
// }
public override void Refresh() public override void Refresh()
@@ -101,6 +137,8 @@ namespace Ichni.RhythmGame
var animationCurveDropdown = var animationCurveDropdown =
inspector.GenerateDropdown(this, trackTimeSubmoduleSettings, "Animation Curve", typeof(AnimationCurveType), nameof(animationCurveType)) inspector.GenerateDropdown(this, trackTimeSubmoduleSettings, "Animation Curve", typeof(AnimationCurveType), nameof(animationCurveType))
.AddListenerFunction(RefreshChildren); .AddListenerFunction(RefreshChildren);
// var isGoWithZToggle =
// inspector.GenerateToggle(this, trackTimeSubmoduleSettings, "Go With Z", nameof(isGoWithZ));
var deleteButton = inspector.GenerateButton(this, trackTimeSubmoduleSettings, "Delete", () => var deleteButton = inspector.GenerateButton(this, trackTimeSubmoduleSettings, "Delete", () =>
{ {
Delete(); Delete();

View File

@@ -32,7 +32,7 @@ namespace Ichni.Editor
isPlaying = !isPlaying; isPlaying = !isPlaying;
EditorManager.instance.songInformation.songTime = audioSource.time - EditorManager.instance.songInformation.offset; audioSource.time = EditorManager.instance.songInformation.songTime + EditorManager.instance.songInformation.offset;
if (isPlaying) if (isPlaying)
{ {
Trail.FreezeAllTrails(!isPlaying); Trail.FreezeAllTrails(!isPlaying);
@@ -51,8 +51,9 @@ namespace Ichni.Editor
} }
public void PauseMusic() public void PauseMusic()
{ {
if (isPlaying) EditorManager.instance.songInformation.songTime = audioSource.time - EditorManager.instance.songInformation.offset;
isPlaying = false; isPlaying = false;
EditorManager.instance.songInformation.songTime = audioSource.time - EditorManager.instance.songInformation.offset;
audioSource.Pause(); audioSource.Pause();
Trail.FreezeAllTrails(!isPlaying); Trail.FreezeAllTrails(!isPlaying);
} }

View File

@@ -481,7 +481,7 @@ namespace Ichni
private void AutoSave() private void AutoSave()
{ {
List<string> saveFiles = GetSortedSaveFiles(); List<string> saveFiles = GetSortedSaveFiles();
if (saveFiles.Count > 0) if (saveFiles.Count > 0)
{ {
// 删除最旧的存档(如果超过数量) // 删除最旧的存档(如果超过数量)
@@ -490,14 +490,14 @@ namespace Ichni
string oldestSave = saveFiles[saveFiles.Count - 1]; string oldestSave = saveFiles[saveFiles.Count - 1];
File.Delete(oldestSave); File.Delete(oldestSave);
saveFiles.RemoveAt(saveFiles.Count - 1); saveFiles.RemoveAt(saveFiles.Count - 1);
LogWindow.Log("AutoSave finished, the oldest file deleted"); LogWindow.Log("AutoSave finished, the oldest file deleted");
} }
else else
{ {
LogWindow.Log("AutoSave finished"); LogWindow.Log("AutoSave finished");
} }
// 依次重命名存档 // 依次重命名存档
for (int i = saveFiles.Count - 1; i >= 0; i--) for (int i = saveFiles.Count - 1; i >= 0; i--)
{ {

Binary file not shown.

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 3f85d2b6703d7644bb36ee4814c36f5b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 5b0c28a9a3a4665449562bf151644ca6
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: e851f104723c1c94cab5857310957aa2
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,2 +0,0 @@
§vϦ
½ŠVòÇ~~ù]@Ÿ{Ó“U†…_cW¾ —NóI-M|ãw ¾ù­ý÷U†€ò°º˜iÕ®<C395>¹Ëñi³B,é0!Qʳâ°€L0¸¾µ|ìL~<päsxúÛ°3è gè"à\W¬ý èÂÍ”ºéjjJwtγù¥<C3B9>M{¸7ÁI¤E°Í!¥àÁ°µ¯Ayªsù àBëñ¯Î¥XΔœEnKD±—Ùå¿´QÛOÕp:ì<>s

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: cccff8d62af2dad4d946d04ac34e3afa
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: ec3443eccd7a1a043b1f446923cce9de
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 876ff5d46bbf2254d87c7878f07c96fe
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 93e3c4a3a3e107245be89e837bac8dba
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 70234191c4201d74cb627a7bf5c4b5fd
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 32f8bccb6f8c938458d81f2ab86b314e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: af03f32531421ef4faea209f8dd30147
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 8e90f9552aff91b4f9cbeee2c21462c4
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -55,7 +55,7 @@
] ]
}, },
"trackPercent" : { "trackPercent" : {
"value" : 0.9978767, "value" : 0.6821997,
"currentAnimationIndex" : 0, "currentAnimationIndex" : 0,
"animations" : [ "animations" : [
{ {

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: b7c01dc82ca9bb54c82ff9e0e7924008 guid: a2ffb7e2b665348d8af211996c337be6
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}

File diff suppressed because one or more lines are too long