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;
        }
Beispiel #2
0
        private void Init()
        {
            if (_apiKey == null)
            {
                _apiKey = ApiKey.LoadCached();

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

                    submitKey.OnKeyResolve += (key) => {
                        _apiKey = key;
                        ApiKey.Cache(key);

                        _currentView = null;
                    };
                }
            }
        }