InputShowBridge.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System;
  2. using Core;
  3. using UnityEngine;
  4. public class InputShowBridge : BaseBehaviour
  5. {
  6. private bool _hasBridgeOpend
  7. {
  8. get
  9. {
  10. return RoundStorage.Get("E2_hasBridgeOpend", false);
  11. }
  12. set
  13. {
  14. RoundStorage.Set("E2_hasBridgeOpend", value);
  15. }
  16. }
  17. private void Start()
  18. {
  19. if (this._hasBridgeOpend)
  20. {
  21. this._prompt.gameObject.SetActive(false);
  22. }
  23. }
  24. private void Update()
  25. {
  26. if (Mathf.Abs(R.Player.Transform.position.x - base.transform.position.x) < 2f && Core.Input.Game.Search.OnClick && !this.activeObj.activeSelf)
  27. {
  28. this._hasBridgeOpend = true;
  29. this.activeObj.SetActive(true);
  30. this.bridgeCollider.SetActive(true);
  31. this._e2p9.SetActive(false);
  32. this._prompt.FadeOut();
  33. this._prompt.GetComponent<BoxCollider2D>().enabled = false;
  34. }
  35. }
  36. [SerializeField]
  37. private GameObject activeObj;
  38. [SerializeField]
  39. private GateEnterPrompt _prompt;
  40. [SerializeField]
  41. private GameObject bridgeCollider;
  42. [SerializeField]
  43. private GameObject _e2p9;
  44. }