public override void OnEnable() { base.OnEnable(); // resolves TlsException error ServicePointManager.ServerCertificateValidationCallback = Validator; GoogleDataSettings settings = GoogleDataSettings.Instance; if (settings != null) { if (string.IsNullOrEmpty(settings.OAuth2Data.client_id) || string.IsNullOrEmpty(settings.OAuth2Data.client_secret)) { Debug.LogWarning("Client_ID and Client_Sceret is empty. Reload .json file."); } if (string.IsNullOrEmpty(settings._AccessCode)) { Debug.LogWarning("AccessCode is empty. Redo authenticate again."); } } else { Debug.LogError("Failed to get google data settings. See the google data setting if it has correct path."); return; } }
public void OnEnable() { setting = target as GoogleDataSettings; // resolve TlsException error UnsafeSecurityPolicy.Instate(); }
protected override void OnEnable() { base.OnEnable(); // resolve TlsException error UnsafeSecurityPolicy.Instate(); machine = target as GoogleMachine; if (machine != null) { machine.ReInitialize(); if (GoogleDataSettings.GetSettings() != null) { // Specify paths with one on the GoogleDataSettings.asset file. if (string.IsNullOrEmpty(GoogleDataSettings.Instance.RuntimePath) == false) { machine.RuntimeClassPath = GoogleDataSettings.Instance.RuntimePath; } if (string.IsNullOrEmpty(GoogleDataSettings.Instance.EditorPath) == false) { machine.EditorClassPath = GoogleDataSettings.Instance.EditorPath; } } } }
/// <summary> /// Create account setting asset file if it does not exist. /// </summary> public static GoogleDataSettings Create() { string filePath = CustomAssetUtility.GetUniqueAssetPathNameOrFallback(AssetFileName); s_Instance = (GoogleDataSettings)AssetDatabase.LoadAssetAtPath(filePath, typeof(GoogleDataSettings)); if (s_Instance == null) { s_Instance = CreateInstance <GoogleDataSettings>(); string path = CustomAssetUtility.GetUniqueAssetPathNameOrFallback(AssetFileName); AssetDatabase.CreateAsset(s_Instance, path); s_Instance.AssetPath = Path.GetDirectoryName(path); s_Instance.AssetPath += "/"; // saves file path of the created asset. EditorUtility.SetDirty(s_Instance); AssetDatabase.SaveAssets(); EditorUtility.DisplayDialog( "Validate Settings", "Default google data settings file has been created for accessing Google project page. You should validate these before proceeding.", "OK" ); } else { Debug.LogWarning("Already exist at " + filePath); } Selection.activeObject = s_Instance; return(s_Instance); }
public void OnEnable() { setting = target as GoogleDataSettings; UnsafeSecurityPolicy.Instate(); }
public static void CreateGoogleDataSetting() { GoogleDataSettings.Create(); }