private void OnGUI() { if (currentPlatform == null) { return; } if (!hasAuthorization) { EditorGUILayout.LabelField("To allow incoming network data you should disable firewall blocking rule!", Styles.label, null); GUILayout.FlexibleSpace(); GUI.color = new Color(0, .8f, 0); if (GUILayout.Button("Disable rule", GUILayout.Height(42))) { currentPlatform.GrantAuthorization(); hasAuthorization = currentPlatform.HasAuthorization(); } } else { EditorGUILayout.LabelField("Networking should now work!", Styles.label, null); GUILayout.FlexibleSpace(); GUI.color = new Color(.8f, 0, 0); if (GUILayout.Button("Enable rule", GUILayout.Height(42))) { currentPlatform.RemoveAuthorization(); hasAuthorization = currentPlatform.HasAuthorization(); } } GUILayout.FlexibleSpace(); GUI.color = Color.white; if (GUILayout.Button("Default")) { currentPlatform.RemoveAuthorization(); hasAuthorization = currentPlatform.HasAuthorization(); } if (GUILayout.Button("Close")) { Close(); } }
private void OnEnable() { if (currentPlatform == null) { currentPlatform = GetPlatform(); hasAuthorization = currentPlatform.HasAuthorization(); } }
private static void InitializeOnLoad() { if (CheckAuthorizationOnPlay && Application.isPlaying) { currentPlatform = GetPlatform(); hasAuthorization = currentPlatform.HasAuthorization(); if (!hasAuthorization) { OpenUtils(); } } }