2023-02-21 16:42:21 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using HeavenStudio.Util;
|
|
|
|
|
|
|
|
namespace HeavenStudio.Games.Scripts_SneakySpirits
|
|
|
|
{
|
|
|
|
public class SneakySpiritsGhost : MonoBehaviour
|
|
|
|
{
|
|
|
|
private SneakySpirits game;
|
|
|
|
private Animator anim;
|
|
|
|
|
|
|
|
void Awake()
|
|
|
|
{
|
|
|
|
anim = GetComponent<Animator>();
|
|
|
|
game = SneakySpirits.instance;
|
|
|
|
}
|
|
|
|
|
2023-06-10 19:13:29 +00:00
|
|
|
public void Init(double spawnBeat, float length)
|
2023-02-21 16:42:21 +00:00
|
|
|
{
|
2023-07-13 00:35:47 +00:00
|
|
|
if (length == 0) length = 1;
|
2023-02-21 16:42:21 +00:00
|
|
|
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
2023-07-13 00:35:47 +00:00
|
|
|
new BeatAction.Action(spawnBeat, delegate { anim.DoScaledAnimationAsync("Move", (1 / length) * Conductor.instance.SongPitch); }),
|
|
|
|
new BeatAction.Action(spawnBeat + (length * 0.5f), delegate { anim.DoScaledAnimationAsync("MoveDown", (1 / length) * Conductor.instance.SongPitch); }),
|
2023-02-21 16:42:21 +00:00
|
|
|
new BeatAction.Action(spawnBeat + length, delegate { Destroy(gameObject); }),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|