From 70f2901e4f6aeb216cd9203089347e375a215f3d Mon Sep 17 00:00:00 2001 From: minenice55 Date: Mon, 25 Dec 2023 23:55:01 -0500 Subject: [PATCH] controller support in opening --- Assets/Scenes/Opening.unity | 10 +--------- Assets/Scripts/OpeningManager.cs | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Assets/Scenes/Opening.unity b/Assets/Scenes/Opening.unity index c9d223d5f..98cc7c667 100644 --- a/Assets/Scenes/Opening.unity +++ b/Assets/Scenes/Opening.unity @@ -1243,15 +1243,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: 'If you''re coming from an older version of Heaven Studio, copy your settings - config over from - - AWWWWWWW BWWWWWWW CWWWWWW DWWWWWWW - - to - - AWWWWWWW - BWWWWWWW CWWWWWW DWWWWWWW' + m_text: m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: e5f3069ff426f2546b8168857ad6e0d4, type: 2} m_sharedMaterial: {fileID: 1618155055176292627, guid: e5f3069ff426f2546b8168857ad6e0d4, type: 2} diff --git a/Assets/Scripts/OpeningManager.cs b/Assets/Scripts/OpeningManager.cs index 183e44da1..98765e7c2 100644 --- a/Assets/Scripts/OpeningManager.cs +++ b/Assets/Scripts/OpeningManager.cs @@ -96,11 +96,24 @@ namespace HeavenStudio IEnumerator WaitAndFinishOpening() { - WaitUntil wait = new WaitUntil(() => Input.anyKeyDown || (timer >= 8)); + WaitUntil wait = new WaitUntil(() => CheckForInput() || (timer >= 8)); yield return wait; OnFinishDisclaimer(0.35f); } + bool CheckForInput() + { + var controllers = PlayerInput.GetInputControllers(); + foreach (var newController in controllers) + { + if (newController.GetLastButtonDown(true) > 0) + { + return true; + } + } + return false; + } + void OnFinishDisclaimer(float fadeDuration = 0) { openingAudio.Stop();