コード例 #1
0
        private void Awake()
        {
            LockReload();

            _appCache = Config.Instance().Cache;

            _apiKey = ApiKey.LoadCached();

            if (_apiKey == null)
            {
                var submitKey = new Views.SubmitKey();

                submitKey.OnKeyResolve += OnKeyResolved;

                _currentView = submitKey;
            }
            else
            {
                _api = new ApiUtils(_apiKey);
                string selectedAppSecret = _appCache.AppByPlatform(EditorUserBuildSettings.activeBuildTarget);

                if (string.IsNullOrEmpty(selectedAppSecret))
                {
                    BeginSelectAppView();
                }
                else
                {
                    _selectedApp = _api.GetAppInfo(selectedAppSecret);
                    BeginSelectAppView();
                }
            }
            messagesView.OnChangeApp += BeginBuildView;
        }
コード例 #2
0
        private void Init()
        {
            if (_apiKey == null)
            {
                _apiKey = ApiKey.LoadCached();
                if (_apiKey == null)
                {
                    return;
                }
            }

            if (_api == null)
            {
                _api = new ApiUtils(_apiKey);
            }

            _appCache = Config.Instance().Cache;

            _cachedAppsView = _appCache.AppsByPlatform()
                              .Select(entry => new KeyValuePair <BuildTarget, Views.EditableApp>(entry.Key, new Views.EditableApp(entry.Key, _api, entry.Value)))
                              .ToDictionary(entry => entry.Key, entry => entry.Value);
        }