controller support in opening

This commit is contained in:
minenice55 2023-12-25 23:55:01 -05:00
parent b7000de9cc
commit 70f2901e4f
2 changed files with 15 additions and 10 deletions

View file

@ -1243,15 +1243,7 @@ MonoBehaviour:
m_OnCullStateChanged: m_OnCullStateChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_text: 'If you''re coming from an older version of Heaven Studio, copy your settings m_text:
config over from
AWWWWWWW BWWWWWWW CWWWWWW DWWWWWWW
to
AWWWWWWW
BWWWWWWW CWWWWWW DWWWWWWW'
m_isRightToLeft: 0 m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: e5f3069ff426f2546b8168857ad6e0d4, type: 2} m_fontAsset: {fileID: 11400000, guid: e5f3069ff426f2546b8168857ad6e0d4, type: 2}
m_sharedMaterial: {fileID: 1618155055176292627, guid: e5f3069ff426f2546b8168857ad6e0d4, type: 2} m_sharedMaterial: {fileID: 1618155055176292627, guid: e5f3069ff426f2546b8168857ad6e0d4, type: 2}

View file

@ -96,11 +96,24 @@ namespace HeavenStudio
IEnumerator WaitAndFinishOpening() IEnumerator WaitAndFinishOpening()
{ {
WaitUntil wait = new WaitUntil(() => Input.anyKeyDown || (timer >= 8)); WaitUntil wait = new WaitUntil(() => CheckForInput() || (timer >= 8));
yield return wait; yield return wait;
OnFinishDisclaimer(0.35f); 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) void OnFinishDisclaimer(float fadeDuration = 0)
{ {
openingAudio.Stop(); openingAudio.Stop();