private void ShowAccountSettings() { showApiKeySettings = EditorGUILayout.Foldout(showApiKeySettings, "Scape Account"); if (showApiKeySettings) { ShowLogo(); Rect DevelopmentSettings = EditorGUILayout.BeginHorizontal("box"); { Rect DevID = EditorGUILayout.BeginHorizontal("box"); { GUILayout.Label("Enter your Scape API Key here:"); var newKey = EditorGUILayout.TextField(apiKey); if (newKey != apiKey) { apiKey = newKey; ScapeClient.SaveApiKeyToResource(apiKey); } } EditorGUILayout.EndHorizontal(); } EditorGUILayout.EndHorizontal(); if (GUILayout.Button("Acquire API Key!")) { this.Close(); Application.OpenURL("https://developer.scape.io/dashboard/"); } } }
public void OnPreprocessBuild(BuildReport report) { var apiKey = ScapeClient.RetrieveKeyFromResources(); if (apiKey == "") { EditorUtility.DisplayDialog("Warning!", "A ScapeAPI key has not been set.", "Ok"); } }
/// <summary> /// create c interface on awake /// </summary> public void Awake() { if (instance != null) { Debug.Log("ERROR: There should only be one ScapeClient in a scene!"); return; } instance = this; nativeClient = new ScapeClientNative(); }
/// <summary> /// terminate client on scene /// </summary> public void OnDestroy() { nativeClient.Terminate(); instance = null; }
void OnLostFocus() { ScapeClient.SaveApiKeyToResource(apiKey); }
void Awake() { apiKey = ScapeClient.RetrieveKeyFromResources(); }
void OnDestroy() { ScapeClient.SaveApiKeyToResource(apiKey); }