public static void Initialize() { // Map = European? // var go = new GameObject("AmericanRoadsignsTool"); try { go.AddComponent <AmericanRoadsignsTool>(); // Init. GUI Components: m_mainbutton = UIView.GetAView().AddUIComponent(typeof(UIMainButton)) as UIMainButton; DebugUtils.Log("MainButton created."); m_mainpanel = UIView.GetAView().AddUIComponent(typeof(UIMainPanel)) as UIMainPanel; DebugUtils.Log("MainPanel created."); // Set vars: isGameLoaded = true; strModLocation = "Workshop"; ConfigFileName = (PluginManager.noWorkshop) ? ConfigFileNameLocal : ConfigFileNameOnline; DebugUtils.Log($"Currently used config File: {ConfigFileName}."); } catch (Exception e) { DebugUtils.LogException(e); if (go != null) { Destroy(go); } } }
private void Start() { EnsureUIComponentsLayout(); cameraPath = gameObject.AddComponent <CameraPath>(); camera = GameObject.Find("Main Camera").GetComponent <Camera>(); cameraController = camera.GetComponent <CameraController>(); unlimitedCamera = cameraController.m_unlimitedCamera; m_notificationAlpha = typeof(NotificationManager).GetField("m_notificationAlpha", BindingFlags.NonPublic | BindingFlags.Instance); if (mainButton == null) { UIView view = UIView.GetAView(); mainButton = view.AddUIComponent(typeof(UIMainButton)) as UIMainButton; mainWindow = view.AddUIComponent(typeof(UIMainWindow)) as UIMainWindow; } try { EZC_config = Type.GetType("EnhancedZoomContinued.EnhancedZoom, EnhancedZoom").GetField("config", BindingFlags.Public | BindingFlags.Static).GetValue(null); EZC_fovSmoothing = EZC_config.GetType().GetField("fovSmoothing"); } catch { } }