12345678910111213141516171819202122232425262728293031323334 |
- using TMPro;
- using UnityEngine;
- using WS;
- public class PointView : View
- {
- public GameObject BasePoint;
- public GameObject OPPoint;
- public GameObject MousePoint;
- public TextMeshProUGUI Text;
- public override void LoadInit()
- {
- ShowModeType = ViewShowModeType.Screen;
- ReferenceCollector rc = UIGameObject.GetComponent<ReferenceCollector>();
- BasePoint = rc.Get<GameObject>("BasePoint");
- OPPoint = rc.Get<GameObject>("OPPoint");
- MousePoint = rc.Get<GameObject>("MousePoint");
- Text = rc.GetComponent<TextMeshProUGUI>("Text");
- }
- private void SetText(string text)
- {
- Text.text = text;
- }
- public void ShowPoint(int index = 0, string text = null)
- {
- SetText(text);
- BasePoint.gameObject.SetActive(index == 0);
- OPPoint.gameObject.SetActive(index == 1);
- MousePoint.gameObject.SetActive(index == 2);
- }
- }
|