123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using XRTool.Util;
- public class JinRuRenwu : MonoBehaviour
- {
- public GameObject TaskGo;
- public GameObject PaiZhaoGo;
- public GameObject Video;
- public GameObject Model;
- public GameObject Image;
- public GameObject Text;
- public List<GameObject> updateList;
- public GameObject kong;
- private void OnEnable()
- {
-
- updateListRef();
- TimerMgr.Instance.CreateTimer(()=> {
- kong.SetActive(!kong.activeSelf);
- },0.01f,6);
- }
- private void OnDisable()
- {
-
- }
- public void showAll()
- {
- Text.SetActive(true);
- Image.SetActive(true);
- Model.SetActive(true);
- Video.SetActive(true);
- PaiZhaoGo.SetActive(true);
- }
- public void showText()
- {
- Text.SetActive(!Text.activeSelf);
- Text.transform.SetAsFirstSibling();
- }
- public void showImage()
- {
- Image.SetActive(!Image.activeSelf);
- Text.transform.SetAsFirstSibling();
- }
- public void showModel()
- {
- Model.SetActive(!Model.activeSelf);
- Text.transform.SetAsFirstSibling();
- }
- public void showVideo()
- {
- Video.SetActive(!Video.activeSelf);
- Text.transform.SetAsFirstSibling();
- }
- public void GotoPaiZhao()
- {
- PaiZhaoGo.SetActive(!PaiZhaoGo.activeSelf);
- Text.transform.SetAsFirstSibling();
- }
- public void GotoTask()
- {
- TaskGo.SetActive(!TaskGo.activeSelf);
- }
- public void updateListRef()
- {
- for (int i = updateList.Count-1; i >=0; i--)
- {
- if ((updateList[i].GetComponent<ContentSizeFitter>()))
- {
- updateList[i].GetComponent<ContentSizeFitter>().SetLayoutVertical();
- updateList[i].GetComponent<ContentSizeFitter>().SetLayoutHorizontal();
- }
- if (updateList[i].GetComponent<HorizontalLayoutGroup>())
- {
- updateList[i].GetComponent<HorizontalLayoutGroup>().SetLayoutHorizontal();
- updateList[i].GetComponent<HorizontalLayoutGroup>().CalculateLayoutInputHorizontal();
- }
- if ((updateList[i].GetComponent<VerticalLayoutGroup>()))
- {
- updateList[i].GetComponent<VerticalLayoutGroup>().SetLayoutVertical();
- updateList[i].GetComponent<VerticalLayoutGroup>().CalculateLayoutInputVertical();
- }
- }
- }
- }
|