using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class ButtonLeftRight : MonoBehaviour { public Button[] buttonRotasi; // 0 left 1 right public static GameObject targetRotasi; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } public void TargetFound(GameObject targetObject) { for (int i = 0; i < buttonRotasi.Length; i++) { buttonRotasi[i].interactable = true; } targetRotasi = targetObject; } public void TargetLost() { for (int i = 0; i < buttonRotasi.Length; i++) { buttonRotasi[i].interactable = false; } } }