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(); game = SneakySpirits.instance; } public void Init(double spawnBeat, float length) { BeatAction.New(game.gameObject, new List() { new BeatAction.Action(spawnBeat + 0.001f, delegate { anim.DoScaledAnimationAsync("Move", 1f); }), new BeatAction.Action(spawnBeat + length - 0.5f, delegate { anim.DoScaledAnimationAsync("MoveDown", 1f); }), new BeatAction.Action(spawnBeat + length, delegate { Destroy(gameObject); }), }); } } }