50 lines
1.6 KiB
C#
50 lines
1.6 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class GamePadSelectionConditioner : MonoBehaviour
|
|
{
|
|
[SerializeField] private GameObject conditionObject;
|
|
|
|
[Space]
|
|
[Header("These are the navigation buttons that change depending on 'conditionObject'")]
|
|
[SerializeField] private Button changeMobileNumberButton;
|
|
[SerializeField] private Button crypto_ReturnButton;
|
|
[SerializeField] private Button newMobileNumberButton;
|
|
|
|
[SerializeField] private GameObject gamePadInputFieldBlocker;
|
|
|
|
private void Awake()
|
|
{
|
|
}
|
|
|
|
//no longer needed. But its good code for future reference.
|
|
//void Update()
|
|
//{
|
|
// if (Player.Instance.IsJoystick)
|
|
// {
|
|
// gamePadInputFieldBlocker.SetActive(true);
|
|
// Navigation changeMobileNav = changeMobileNumberButton.navigation;
|
|
// Navigation returnNav = crypto_ReturnButton.navigation;
|
|
// if (conditionObject.activeInHierarchy)
|
|
// {
|
|
// changeMobileNav.selectOnDown = newMobileNumberButton;
|
|
// returnNav.selectOnUp = newMobileNumberButton;
|
|
// }
|
|
// else
|
|
// {
|
|
// changeMobileNav.selectOnDown = crypto_ReturnButton;
|
|
// returnNav.selectOnUp = changeMobileNumberButton;
|
|
// }
|
|
// changeMobileNumberButton.navigation = changeMobileNav;
|
|
// crypto_ReturnButton.navigation = returnNav;
|
|
// }
|
|
// else
|
|
// {
|
|
// gamePadInputFieldBlocker.SetActive(false);
|
|
// }
|
|
|
|
//}
|
|
}
|