| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using DG.Tweening; |
| | | using KTGMGemClient; |
| | | public class MainStartUI : MonoBehaviour |
| | | { |
| | | private Image errorImage; |
| | | private Button pvpPanel; |
| | | private Color normal = new Color(1, 1, 1, 1); |
| | | private Color dis = new Color(1, 1, 1, 0); |
| | | |
| | | // Start is called before the first frame update |
| | | void Start() |
| | | { |
| | | transform.Find("GoToBattleBtn").GetComponent<Button>().onClick.AddListener(OnClickGoToBattleBtn); |
| | | transform.Find("ShowPVPBtn").GetComponent<Button>().onClick.AddListener(OnClickShowPVPBtn); |
| | | transform.Find("ErrorBtn1").GetComponent<Button>().onClick.AddListener(OnClickErrorBtn); |
| | | transform.Find("ErrorBtn2").GetComponent<Button>().onClick.AddListener(OnClickErrorBtn); |
| | | errorImage = transform.Find("ErrorBtn1/ErrorImage").GetComponent<Image>(); |
| | | errorImage.color = dis; |
| | | |
| | | pvpPanel = transform.Find("PVPPanel").GetComponent<Button>(); |
| | | pvpPanel.onClick.AddListener(OnClickPVPPanelBtn); |
| | | pvpPanel.gameObject.SetActive(false); |
| | |
| | | |
| | | private void OnClickGoToBattleBtn() |
| | | { |
| | | gameObject.SetActive(false); |
| | | //跳转场景 |
| | | transform.parent.GetComponent<Loading>().StartLoadingScene(); |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.ChangeScene); |
| | | gameObject.SetActive(false); |
| | | |
| | | //transform.parent.GetComponent<Loading>().StartLoadingScene(); |
| | | } |
| | | private void OnClickShowPVPBtn() |
| | | { |
| | | pvpPanel.gameObject.SetActive(true); |
| | | } |
| | | |
| | | private void OnClickErrorBtn() |
| | | { |
| | | errorImage.DOKill(); |
| | | errorImage.DOColor(normal, 1.0f).OnComplete(() => |
| | | { |
| | | errorImage.DOColor(dis, 1.0f); |
| | | }); |
| | | } |
| | | |
| | | private void OnClickPVPPanelBtn() |