mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-23 18:15:13 +00:00
44 lines
No EOL
1.2 KiB
C#
44 lines
No EOL
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
using RhythmHeavenMania.Util;
|
|
|
|
namespace RhythmHeavenMania.Games.KarateMan
|
|
{
|
|
public class PunchKickSound : MonoBehaviour
|
|
{
|
|
public float startBeat;
|
|
private int index;
|
|
|
|
private void Update()
|
|
{
|
|
float normalizedBeat = Conductor.instance.GetLoopPositionFromBeat(startBeat, 1);
|
|
|
|
if (normalizedBeat >= 1 && index < 1)
|
|
{
|
|
Jukebox.PlayOneShotGame("karateman/punchKick1");
|
|
index++;
|
|
}
|
|
else if (normalizedBeat >= 1.5f && index < 2)
|
|
{
|
|
Jukebox.PlayOneShotGame("karateman/punchKick2");
|
|
index++;
|
|
}
|
|
else if (normalizedBeat >= 1.75f && index < 3)
|
|
{
|
|
Jukebox.PlayOneShotGame("karateman/punchKick3");
|
|
index++;
|
|
}
|
|
else if (normalizedBeat >= 2.25f && index < 4)
|
|
{
|
|
Jukebox.PlayOneShotGame("karateman/punchKick4");
|
|
index++;
|
|
}
|
|
else if (normalizedBeat >= 3)
|
|
{
|
|
Destroy(this.gameObject);
|
|
}
|
|
}
|
|
}
|
|
} |