| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- [Serializable]
- public class TopBarButtonInfo
- {
- public string Name;
- public Image Icon;
- public Text text;
- public bool selected;
- }
- public class HomeView_TopBarView : MonoBehaviour
- {
- public List<TopBarButtonInfo> topBarButtonInfos;
- // Start is called before the first frame update
- void Start()
- {
- TopBarButtonInfo topBarButtonInfo = topBarButtonInfos[0];
- topBarButtonInfo.Icon.color = new Color32(0, 0, 0, 255);
- topBarButtonInfo.text.color = new Color32(48, 57, 57, 255);
- }
- // Update is called once per frame
- //void Update()
- //{
-
- //}
- public void onChangeType(int index)
- {
- if (index > 0 || index < topBarButtonInfos.Count) {
- for (int i = 0; i < topBarButtonInfos.Count; i++)
- {
- TopBarButtonInfo topBarButtonInfo = topBarButtonInfos[i];
- if (i == index) {
- topBarButtonInfo.Icon.color = new Color32(0, 0, 0, 255);
- topBarButtonInfo.text.color = new Color32(48, 57, 57, 255);
- }
- else {
- topBarButtonInfo.Icon.color = new Color32(255, 255, 255, 255);
- topBarButtonInfo.text.color = new Color32(141, 150, 151, 255);
- }
- }
-
- }
- }
- }
|