private void AccountGUI() { GUILayout.Label("Account", EditorStyles.boldLabel); GUILayout.Label("Api key:"); EditorGUILayout.SelectableLabel(_apiKey.Key, EditorStyles.helpBox); EditorGUILayout.BeginHorizontal(); { GUILayout.FlexibleSpace(); if (GUILayout.Button("RESET", GUILayout.Width(100))) { ApiKey.ClearCached(); _apiKey = null; Init(); } GUILayout.FlexibleSpace(); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Separator(); }
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); }