DebugConnectArrow.cs 783 B

1234567891011121314151617181920212223242526
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class DebugConnectArrow : MonoBehaviour
  6. {
  7. [SerializeField] GameObject btnConnectArrow;
  8. void FixedUpdate()
  9. {
  10. UpdateBtnForConnect();
  11. }
  12. BluetoothStatusEnum bowStatus;
  13. BluetoothStatusEnum arrowStatus;
  14. void UpdateBtnForConnect() {
  15. if (BluetoothShoot.ins && arrowStatus != BluetoothShoot.ins.status) {
  16. arrowStatus = BluetoothShoot.ins.status;
  17. (int textID, Color color) = BluetoothStatus.GetStatusInfo(BluetoothShoot.ins.status);
  18. btnConnectArrow.GetComponentInChildren<TextAutoLanguage>().SetText(textID);
  19. btnConnectArrow.GetComponentInChildren<Text>().color = color;
  20. }
  21. }
  22. }