Example #1
0
        public void Init()
        {
            SceneManager.sceneLoaded += SceneLoaded;
            GameObject prefab = HFResourceManager.Instance.GetAsset <GameObject>("hfui", "UICamera");
            GameObject temp   = Instantiate(prefab);

            temp.name = CameraName;
            UICamera  = temp.GetComponent <UICamera>();
            UICamera.SetParent(gameObject);

            prefab = HFResourceManager.Instance.GetAsset <GameObject>("hfui", "UIEventSystem");
            GameObject eventSystem = Instantiate(prefab);

            eventSystem.name = "UIEventSystem";
            eventSystem.transform.SetParent(gameObject.transform);
        }
Example #2
0
        public void Init()
        {
            SceneManager.sceneLoaded += SceneLoaded;
            GameObject prefab = AssetManager.Instance.GetPrefab("hfui", "UICamera");
            GameObject temp   = GameFactory.Instantiate(prefab);

            temp.name = CameraName;
            UICamera  = temp.GetComponent <UICamera>();
            UICamera.SetParent(gameObject);

            prefab = AssetManager.Instance.GetPrefab("hfui", "UIEventSystem");
            GameObject eventSystem = GameFactory.Instantiate(prefab);

            eventSystem.name = "UIEventSystem";
            eventSystem.transform.SetParent(gameObject.transform);

            AddCanvas(0);
        }