From 68d560b8bcba05233e30df203d9e6a9a7b996ad0 Mon Sep 17 00:00:00 2001 From: Mytiaoga <32819046+Mytiaoga@users.noreply.github.com> Date: Mon, 11 Jul 2022 15:38:34 +0800 Subject: [PATCH] First Contact - Toggle Live Bar beat - On beat or Off beat live bar --- .../Games/FirstContact/FirstContact.cs | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Games/FirstContact/FirstContact.cs b/Assets/Scripts/Games/FirstContact/FirstContact.cs index c39216fe..e2395ac6 100644 --- a/Assets/Scripts/Games/FirstContact/FirstContact.cs +++ b/Assets/Scripts/Games/FirstContact/FirstContact.cs @@ -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() + { + 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 //{ @@ -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().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)