remify minigame CatsRhythmGame
This commit is contained in:
8
Assets/02_Scripts/Data/Rhythm.meta
Normal file
8
Assets/02_Scripts/Data/Rhythm.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0935fac81d466184b934e7543b1a3ad3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
24
Assets/02_Scripts/Data/Rhythm/RhythmChart.cs
Normal file
24
Assets/02_Scripts/Data/Rhythm/RhythmChart.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Note
|
||||
{
|
||||
public float Time;
|
||||
}
|
||||
|
||||
[CreateAssetMenu(fileName = "RhythmChart", menuName = "CatsRoom/RhythmChart")]
|
||||
public class RhythmChart : ScriptableObject
|
||||
{
|
||||
public AudioClip SongClip; // 노래 파일
|
||||
public float Bpm; // 분당 박자
|
||||
public float Offset; // 첫 박자 시작 시각
|
||||
public int NoteCount; // 노트 개수 (또는 곡 길이로 자동)
|
||||
public List<Note> GenerateNotes() // BPM·offset으로 시간 목록 자동 생성
|
||||
{
|
||||
List<Note> notes = new List<Note>();
|
||||
float interval = 60f / Bpm;
|
||||
for (int i = 0; i < NoteCount; i++)
|
||||
notes.Add(new Note { Time = Offset + interval * i });
|
||||
return notes;
|
||||
}
|
||||
}
|
||||
2
Assets/02_Scripts/Data/Rhythm/RhythmChart.cs.meta
Normal file
2
Assets/02_Scripts/Data/Rhythm/RhythmChart.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 695b2ba110bb2ca46b704141e71e3d15
|
||||
Reference in New Issue
Block a user