using System.Collections.Generic; using UnityEngine; using SanAndreasUnity.Behaviours; using SanAndreasUnity.Utilities; using UnityEngine.UI; namespace SanAndreasUnity.UI { public class TouchInput : MonoBehaviour { public static TouchInput Instance { get; private set; } public Canvas canvas; public GameObject panel; public GameObject pedMovementInputGo, vehicleInputGo; Button walkButton, sprintButton, jumpButton, crouchButton, enterButton, aimButton, fireButton, flyButton, exitVehicleButton, nextWeaponButton, previousWeaponButton; UIEventsPickup jumpButtonEventsPickup, fireButtonEventsPickup, handbrakePickup, backwardVehiclePickup, forwardVehiclePickup, panelPickup; Text walkButtonText, sprintButtonText, aimButtonText, jumpButtonText, fireButtonText; ArrowsMovementButton movementButton, turnVehicleButton; bool m_walkPressed, m_sprintPressed, m_aimPressed, m_crouchPressed, m_enterPressed, m_flyPressed, m_exitVehiclePressed, m_nextWeaponPressed, m_previousWeaponPressed; public Color activeButtonColor = Color.blue; public Color inactiveButtonColor = Color.black; public float vehicleTurnMultiplier = 1.5f; //List m_panelDeltas = new List(); Vector2 m_panelDeltasSum = Vector2.zero; public float touchPointerSensitivity = 1f; void Awake () { Instance = this; // setup references Transform parent = pedMovementInputGo.transform; walkButton = parent.Find("WalkButton").GetComponent