mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 21:47:39 +02:00
First PlayerActionEvent Pass (#202)
* update blue bear to use PlayerActionEvent * update built to scale DS to use PlayerActionEvent * update clappy trio to use PlayerActionEvent * update crop stomp to use PlayerActionEvent * update drumming practice to use PlayerActionEvent * update fork lifter to use PlayerActionEvent * update minigame icons * update wizard waltz' icon
This commit is contained in:
@ -13,25 +13,27 @@ namespace HeavenStudio.Util
|
||||
|
||||
public class Action
|
||||
{
|
||||
public float beat { get; set; }
|
||||
public double beat { get; set; }
|
||||
public EventCallback function { get; set; }
|
||||
|
||||
public Action(float beat, EventCallback function)
|
||||
public Action(double beat, EventCallback function)
|
||||
{
|
||||
this.beat = beat;
|
||||
this.function = function;
|
||||
}
|
||||
}
|
||||
|
||||
public static void New(GameObject prefab, List<Action> actions)
|
||||
public static BeatAction New(GameObject prefab, List<Action> actions)
|
||||
{
|
||||
BeatAction beatAction = prefab.AddComponent<BeatAction>();
|
||||
beatAction.actions = actions;
|
||||
|
||||
return beatAction;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
float songPositionInBeats = Conductor.instance.songPositionInBeats;
|
||||
double songPositionInBeats = Conductor.instance.songPositionInBeatsAsDouble;
|
||||
|
||||
for (int i = 0; i < actions.Count; i++)
|
||||
{
|
||||
@ -42,6 +44,11 @@ namespace HeavenStudio.Util
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Delete()
|
||||
{
|
||||
Destroy(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user