HeavenStudio/Assets/Scripts/Games/SneakySpirits/SneakySpiritsGhost.cs
Rapandrasmus 4bf4c6ecc9
Sneaky spirits has snuck its way into HS! Wow! Amazing! (#307)
* Started, off to a good start

* Animation shit

* I hope this looks okay

* expose song pitch to minigames

* clean up new additions

* They now lower down

* Da new pitch stuff needs update but I made cool stuff regardless

* Hit sprites implemented

* Added barely animation for ghost

* Missing and barely stuff implemented

* make new functions actually set music pitch

* Bow enter or exit

---------

Co-authored-by: minenice55 <star.elementa@gmail.com>
2023-02-21 16:42:21 +00:00

32 lines
935 B
C#

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;
}
public void Init(float spawnBeat, float length)
{
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(spawnBeat - 0.2f, 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); }),
});
}
}
}