First Contact - Toggle Live Bar beat

- On beat or Off beat live bar
This commit is contained in:
Mytiaoga 2022-07-11 15:38:34 +08:00 committed by GitHub
parent 5e7acfee17
commit 68d560b8bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,6 +27,10 @@ namespace HeavenStudio.Games.Loaders
new Param("type", FirstContact.alienLookAt.lookAtTranslator, "alien look at what", "[Alien] will look at what"),
new Param("type", FirstContact.translatorLookAt.lookAtAlien, "translator look at what", "[Translator] will look at what"),
}),
new GameAction("live bar beat", delegate { FirstContact.instance.liveBarBeat(eventCaller.currentEntity.toggle); }, .5f, false, new List<Param>()
{
new Param("toggle", true, "On Beat", "If the live bar animation will be on beat or not")
}),
//new GameAction("Version of First Contact", delegate { FirstContact.instance.versionOfFirstContact(eventCaller.currentEntity.type); }, .5f, false, new List<Param>
//{
@ -66,6 +70,8 @@ namespace HeavenStudio.Games
public bool isCorrect, noHitOnce, isSpeaking;
//public int version;
public float lookAtLength = 1f;
bool onBeat;
float liveBarBeatOffset;
//public enum VersionOfContact
@ -108,7 +114,7 @@ namespace HeavenStudio.Games
private void Update()
{
//This is taken from the conductor script
if (Conductor.instance.ReportBeat(ref lastReportedBeat))
if (Conductor.instance.ReportBeat(ref lastReportedBeat, offset: liveBarBeatOffset))
{
liveBar.GetComponent<Animator>().Play("liveBar", 0, 0);
}
@ -136,6 +142,18 @@ namespace HeavenStudio.Games
// version = type;
//}
public void liveBarBeat(bool onBeat)
{
if (onBeat)
{
liveBarBeatOffset = 0;
}
else
{
liveBarBeatOffset = .5f;
}
}
public void lookAtDirection(int alienLookAt, int translatorLookAt)
{
switch (alienLookAt)