Ejemplo n.º 1
0
        public void Start()
        {
            try
            {
                // Loading config
                AdvancedVehicleOptions.InitVehicleDataConfig();

                if (AdvancedVehicleOptions.OnLoadValidateServices)
                {
                    AdvancedVehicleOptions.CheckAllServicesValidity();
                }

                m_mainPanel = GameObject.FindObjectOfType <GUI.UIMainPanel>();
                UpdateGUI();

                UIThreading.Operating = true;
            }
            catch (Exception e)
            {
                Logging.Error("UI initialization failed.");
                Logging.LogException(e);

                GameObject.Destroy(gameObject);
            }
        }
        public static void UpdateGUI()
        {
            if (!isGameLoaded)
            {
                return;
            }

            if (!hideGUI && m_mainPanel == null)
            {
                // Creating GUI
                m_mainPanel = UIView.GetAView().AddUIComponent(typeof(GUI.UIMainPanel)) as GUI.UIMainPanel;
            }
            else if (hideGUI && m_mainPanel != null)
            {
                GameObject.Destroy(m_mainPanel.gameObject);
                m_mainPanel = null;
            }
        }
        public void Start()
        {
            try
            {
                // Loading config
                AdvancedVehicleOptionsUID.InitConfig();

                if (AdvancedVehicleOptionsUID.onLoadCheck)
                {
                    AdvancedVehicleOptionsUID.CheckAllServicesValidity();
                }

                m_mainPanel = GameObject.FindObjectOfType <GUI.UIMainPanel>();
                UpdateGUI();
            }
            catch (Exception e)
            {
                DebugUtils.Log("UI initialization failed.");
                DebugUtils.LogException(e);

                GameObject.Destroy(gameObject);
            }
        }