LiftButtonComp.cs 706 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. using Game;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. namespace Comp
  6. {
  7. public class LiftButtonComp : MonoBehaviour
  8. {
  9. private Button _button;
  10. private void Start()
  11. {
  12. _button = GetComponent<Button>();
  13. }
  14. private void Update()
  15. {
  16. if (GameCore.Instance.GetCurState() != null && GameCore.Instance.battleState != null &&
  17. GameCore.Instance.GetCurState() == GameCore.Instance.battleState && GameCore.Instance.liftTimes > 0)
  18. {
  19. _button.interactable = true;
  20. }
  21. else
  22. {
  23. _button.interactable = false;
  24. }
  25. }
  26. }
  27. }