예제 #1
0
파일: UIProcess.cs 프로젝트: nottvlike/EGP
        static IObservable <Unit> LoadUIRoot()
        {
            if (_uiData.uiRoot != null)
            {
                return(Observable.ReturnUnit());
            }

            return(AssetProcess.Load <GameObject>(UIConstant.UI_ROOT_ASSET_NAME).Do(root =>
            {
                _uiData.uiRoot = root.Spawn();
                GameObject.DontDestroyOnLoad(_uiData.uiRoot);
            }).AsUnitObservable());
        }
예제 #2
0
파일: UIProcess.cs 프로젝트: nottvlike/EGP
        static IObservable <Unit> LoadUI(string assetPath)
        {
            if (_uiData.unitDict.ContainsKey(assetPath))
            {
                return(Observable.ReturnUnit());
            }

            return(AssetProcess.Load <GameObject>(assetPath)
                   .Do(asset =>
            {
                WorldManager.Instance.Factory.CreateUI(assetPath, asset, _uiData);
            })
                   .AsUnitObservable());
        }