public UIManager() { UIRootObject = AssetManager.Instance.LoadGameObject(PREFAB_RESOURCES_PATH + "/" + UIROOT_RESOURCES_PATH); UIRootObject.name = UIROOT_RESOURCES_PATH; GameObject.DontDestroyOnLoad(UIRootObject); UICanvas = UIRootObject.transform.Find("CanvasRoot"); Bot = UICanvas.Find("Bot"); Mid = UICanvas.Find("Mid"); Top = UICanvas.Find("Top"); ThreeD = UICanvas.Find("ThreeD"); UIScaler = UICanvas.GetComponent <CanvasScaler>(); Source = UIRootObject.GetComponent <AudioSource>(); if (Source == null) { Source = UIRootObject.AddComponent <AudioSource>(); } Screen.SetResolution((int)RefScreenResolution.x, (int)RefScreenResolution.y, false); }