HeavenStudioPlus/Assets/Scripts/Games/SneakySpirits/SneakySpiritsGhost.cs
Rapandrasmus c00b6f46c3 Games fixes/reworks patch (#501)
* ghosts are scaled now

* Lockstep fully reworked

* mr. bach has been implemented

* Space dance fixes

* oops

* Tap trial rework part 1

* tap trial rework part 2

* oopsie

* Gramps Talk Update

* Space Dance Voice Offsets

* Giraffe done! (Except miss anim)

* bg is not showing up for some reason

* bg not rendering fixed + giraffe fixed

* scrolling done

* fixed space dance and space soccer bg scrolls

* fixed rockers bugs

* adjustment

* fixed el inaccuracies

* particle fix

* changed pitch and volume of monkey tap

* miss anim

* megamix face for girl

* Proper miss anim implementation

* Added force stepping event

* miss anim fix

---------

Co-authored-by: saladplainzone <chocolate2890mail@gmail.com>
Co-authored-by: ev <85412919+evdial@users.noreply.github.com>
2023-07-13 00:35:47 +00:00

32 lines
1 KiB
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(double spawnBeat, float length)
{
if (length == 0) length = 1;
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
{
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); }),
new BeatAction.Action(spawnBeat + length, delegate { Destroy(gameObject); }),
});
}
}
}