Files
ichni_Official/Assets/Scripts/Game/Base/ProjectFiles/SongInformation.cs

64 lines
1.9 KiB
C#
Raw Normal View History

2025-06-03 02:42:28 -04:00
using System.Collections;
using System.Collections.Generic;
using Ichni.RhythmGame.Beatmap;
using UnityEngine;
namespace Ichni.RhythmGame
{
public class SongInformation : IBaseElement
{
public AudioClip song; //曲目
public string songName;
public string songLocation; //曲名
public float bpm; //每分钟节拍数
public float delay; //设定音乐和谱面延迟Delay秒后开始在延迟中SongPosition为负数。
2025-07-21 05:42:20 -04:00
public float songLength;
public float offset = 0f;
2025-06-03 02:42:28 -04:00
public BaseElement_BM matchedBM { get; set; }
2025-07-21 05:42:20 -04:00
public SongInformation(string songName, float bpm, float delay, float offset)
2025-06-03 02:42:28 -04:00
{
this.songName = songName;
this.bpm = bpm;
this.delay = delay;
2025-07-21 05:42:20 -04:00
this.offset = offset;
2025-08-22 14:54:40 -04:00
2025-07-08 14:28:40 -04:00
GameManager.instance.audioManager.songPlayer.songTimeSegment = -delay; // 初始化时,歌曲时间为负
2025-06-03 02:42:28 -04:00
}
public void SaveBM()
{
2025-07-21 05:42:20 -04:00
matchedBM = new SongInformation_BM(songName, bpm, delay, offset);
2025-06-03 02:42:28 -04:00
}
}
namespace Beatmap
{
public class SongInformation_BM : BaseElement_BM
{
public string songName;
public float bpm;
public float delay;
2025-07-21 05:42:20 -04:00
public float offset = 0f;
2025-06-03 02:42:28 -04:00
public SongInformation_BM()
{
}
2025-07-21 05:42:20 -04:00
public SongInformation_BM(string songName, float bpm, float delay, float offset)
2025-06-03 02:42:28 -04:00
{
this.songName = songName;
this.bpm = bpm;
this.delay = delay;
2025-07-21 05:42:20 -04:00
this.offset = offset;
2025-06-03 02:42:28 -04:00
}
public override void ExecuteBM()
{
2025-07-21 05:42:20 -04:00
GameManager.instance.songInformation = new SongInformation(songName, bpm, delay, offset);
2025-06-03 02:42:28 -04:00
}
}
}
}