| 12345678910111213141516171819202122232425262728293031323334353637 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- /* 主界面右上方信息栏 */
- public class TopBarView : MonoBehaviour
- {
- [SerializeField] Text[] itemValueTexts;
- [SerializeField] Button[] itemPlusButtons;
- int[] itemValues = {-1, -1, -1};
- void Start()
- {
-
- }
- void Update()
- {
- if (itemValues[0] != LoginMgr.myUserInfo.diamond) {
- itemValues[0] = LoginMgr.myUserInfo.diamond;
- itemValueTexts[0].text = itemValues[0].ToString();
- }
- if (itemValues[1] != LoginMgr.myUserInfo.coin) {
- itemValues[1] = LoginMgr.myUserInfo.coin;
- itemValueTexts[1].text = itemValues[1].ToString();
- }
- if (itemValues[2] != LoginMgr.myUserInfo.integral) {
- itemValues[2] = LoginMgr.myUserInfo.integral;
- itemValueTexts[2].text = itemValues[2].ToString();
- }
- }
- public void GoToSetup() {
- AudioMgr.ins.PlayBtn();
- GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/SetUpView1"), Vector3.zero, new Quaternion());
- }
- }
|