mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 12:37:37 +02:00
Better Sound Sequences (#190)
* add way of creating sound sequences in inspector - actually implement GameAction preFunction - implement sound scheduling for Jukebox and MultiSound * Dj School: fix turntable effect being parented to root * Pajama Party: fix sleep action type not carrying over between transitions
This commit is contained in:
@ -2,11 +2,15 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
using HeavenStudio.Util;
|
||||
|
||||
namespace HeavenStudio.Games
|
||||
{
|
||||
public class Minigame : MonoBehaviour
|
||||
{
|
||||
public static float earlyTime = 0.1f, perfectTime = 0.08f, aceEarlyTime = 0.025f, aceLateTime = 0.025f, lateTime = 0.08f, endTime = 0.1f;
|
||||
[SerializeField] public SoundSequence.SequenceKeyValue[] SoundSequences;
|
||||
|
||||
public List<Minigame.Eligible> EligibleHits = new List<Minigame.Eligible>();
|
||||
|
||||
[System.Serializable]
|
||||
@ -211,5 +215,18 @@ namespace HeavenStudio.Games
|
||||
|
||||
return sameTime;
|
||||
}
|
||||
|
||||
public MultiSound PlaySoundSequence(string name, float startBeat)
|
||||
{
|
||||
foreach (SoundSequence.SequenceKeyValue pair in SoundSequences)
|
||||
{
|
||||
if (pair.name == name)
|
||||
{
|
||||
return pair.sequence.Play(startBeat);
|
||||
}
|
||||
}
|
||||
Debug.LogWarning($"Sound sequence {name} not found in game {this.name} (did you build AssetBundles?)");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user