Cease v0.5
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using Scampz.GameJam.Assets.Scripts;
|
||||
using Scampz.GameJam.Assets.Scripts.Audio;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace Scampz.GameJam
|
||||
@@ -16,6 +16,20 @@ namespace Scampz.GameJam
|
||||
[SerializeField]
|
||||
private TextMeshProUGUI _promptText;
|
||||
|
||||
private InputAction confirmAction;
|
||||
|
||||
void Start()
|
||||
{
|
||||
confirmAction = new InputAction("confirm", binding: "<Keyboard>/x");
|
||||
confirmAction.AddBinding("<GamePad>/buttonSouth");
|
||||
confirmAction.Enable();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
confirmAction.Disable();
|
||||
}
|
||||
|
||||
void OnTriggerEnter(Collider collider)
|
||||
{
|
||||
if (!_loaded && collider.CompareTag("Player"))
|
||||
@@ -30,7 +44,7 @@ namespace Scampz.GameJam
|
||||
|
||||
private void OnTriggerStay(Collider collider)
|
||||
{
|
||||
if (!_loaded && collider.CompareTag("Player") && _promptText != null && _promptText.enabled && Input.GetButton(InputOptions.Submit))
|
||||
if (!_loaded && collider.CompareTag("Player") && _promptText != null && _promptText.enabled && confirmAction.IsPressed())
|
||||
LoadNextLevel();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user