Skip to content
Snippets Groups Projects
Select Git revision
  • 3697e791b5f2938386050324ae9503479c9364ff
  • main default
  • master
  • tempAndrToMaster
4 results

SmartMenu.cs

Blame
  • UI_OnOff_InputModule.cs 1.25 KiB
    using UnityEngine;
    //using static StreamingAssetLoader;
    //using static CheckServer;
    //using static CommunicationEvents;
    
    
    public class UI_OnOff_InputModule : MonoBehaviour
    {
    
        public GameObject myself_GObj;
        public int myInputModule_ID;
        //public int default_value;
        private bool cA = true;
        private int before = -99;
    
    
        void Start()
        {
    
        }
    
        private void Update()
        {
            if (cA && before != UIconfig.InputManagerVersion)
            {
                if (UIconfig.InputManagerVersion == myInputModule_ID)
                {
                    ActivateUIC();
                }
                else
                {
    
                    ClearUIC();
    
                }
                before = UIconfig.InputManagerVersion;
            }
        }
    
    
    
    
        /// <summary>
        /// Activates all Pages.
        /// </summary>
        private void ActivateUIC()
        {
    
            for (int i = 0; i < myself_GObj.transform.childCount; i++)
            {
                myself_GObj.transform.GetChild(i).gameObject.SetActive(true);
            }
        }
    
    
        /// <summary>
        /// Deactivates all Pages.
        /// </summary>
        private void ClearUIC()
        {
    
            for (int i = 0; i < myself_GObj.transform.childCount; i++)
            {
                myself_GObj.transform.GetChild(i).gameObject.SetActive(false);
            }
        }
    
    
    }