44 lines
1022 B
C#
44 lines
1022 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using UnityEngine.InputSystem;
|
|
//using static UnityEditor.Experimental.GraphView.GraphView;
|
|
|
|
public class PlayerButton : MonoBehaviour
|
|
{
|
|
[SerializeField] private bool isAvailable = true;
|
|
public bool IsAvailable { get => isAvailable; set => isAvailable = value; }
|
|
|
|
[SerializeField] private Button button;
|
|
|
|
// Reference to the associated PlayerInput
|
|
public PlayerInput playerInput;
|
|
|
|
// Reference to the associated InputDevice
|
|
[HideInInspector] public InputDevice device;
|
|
|
|
|
|
private void Awake()
|
|
{
|
|
button = GetComponent<Button>();
|
|
playerInput = GetComponent<PlayerInput>();
|
|
}
|
|
|
|
|
|
private void OnEnable()
|
|
{
|
|
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
|
|
}
|
|
private void Update()
|
|
{
|
|
}
|
|
}
|
|
|
|
/*player1 = PlayerInput.Instantiate(playerPrefab, controlScheme: "Arrows", pairWithDevice: Keyboard.current);
|
|
player2 = PlayerInput.Instantiate(playerPrefab, controlScheme: "WASD", pairWithDevice: Keyboard.current);*/
|
|
|