Exemple #1
0
        void Awake()
        {
            Instance = this;
#if UNITY_EDITOR
            Debug.Log("We are " + (ResourceMgr.SimulateAssetBundleInEditor ? "in Editor simulation mode" : "in normal mode"));
#endif
            GameObject.DontDestroyOnLoad(this);
        }
Exemple #2
0
        public GameObject GetSingleUI(UIType uiType)
        {
            if (_UIDict.ContainsKey(uiType) == false || _UIDict[uiType] == null)
            {
                GameObject UIRootCanvas = GameObject.Find("UIRootCanvas");
//				GameObject UICamera = UIRootCanvas.transform.FindChild("UICamera").gameObject;
                GameObject go = ResourceMgr.GetGameObject(URLConst.GetUI(uiType.Name));
                go.transform.SetParent(UIRootCanvas.transform);
                go.transform.localPosition = new Vector3(0, 0, 0);
                go.transform.localScale    = new Vector3(1, 1, 1);
                Canvas canvas = go.GetComponent <Canvas>();
//				Camera camera = UICamera.GetComponent<Camera>();
                canvas.renderMode = RenderMode.ScreenSpaceCamera;
//				canvas.worldCamera = camera;
                _UIDict.AddOrReplace(uiType, go);
                return(go);
            }
            return(_UIDict[uiType]);
        }