HeavenStudio/Assets/Scripts/Games/GleeClub/GleeClubSingInput.cs
Rapandrasmus 039c33b138
Glee Club REAL! (#346)
* Got some basics down

* Started on the event stuff

* Stop wail added

* Baton cue added

* quick anim fixes

* Started on hearts and miss faces

* Did anim stuff

* anim fixes

* Together Now!

* Glee Club - Together Now & Anim Fixes

* Forcesing added

* Street Spirit (Fade Out)

* Pitching Slider for conductor voice

* Small tweaks to glee club

* Repeating tickbox added to glee club sing event

* Toggle chorus kid presence added

---------

Co-authored-by: ev <85412919+evdial@users.noreply.github.com>
Co-authored-by: saladplainzone <chocolate2890mail@gmail.com>
Co-authored-by: minenice55 <star.elementa@gmail.com>
2023-03-15 01:28:03 +00:00

70 lines
1.7 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Util;
namespace HeavenStudio.Games.Scripts_GleeClub
{
public class GleeClubSingInput : PlayerActionObject
{
public float pitch = 1f;
bool shouldClose = true;
bool shouldOpen = true;
private GleeClub game;
void Awake()
{
game = GleeClub.instance;
}
public void Init(float beat, float length, int close)
{
shouldClose = close != (int)GleeClub.MouthOpenClose.OnlyOpen;
shouldOpen = close != (int)GleeClub.MouthOpenClose.OnlyClose;
if (shouldOpen) game.ScheduleInput(beat - 1, 1, InputType.STANDARD_UP, Just, Miss, Out);
if (shouldClose) game.ScheduleInput(beat, length, InputType.STANDARD_DOWN, JustClose, MissClose, Out);
}
public void Just(PlayerActionEvent caller, float state)
{
if (!game.playerChorusKid.singing)
{
game.playerChorusKid.currentPitch = pitch;
game.playerChorusKid.StartSinging();
}
if (!shouldClose) CleanUp();
}
public void JustClose(PlayerActionEvent caller, float state)
{
game.playerChorusKid.StopSinging();
CleanUp();
}
public void MissClose(PlayerActionEvent caller)
{
game.missed = true;
CleanUp();
}
public void Miss(PlayerActionEvent caller)
{
game.missed = true;
if (!shouldClose) CleanUp();
}
public void Out(PlayerActionEvent caller)
{
}
void CleanUp()
{
Destroy(gameObject);
}
}
}