public static void OnGUI() { #if !UNITY_2018_3_OR_NEWER scrollPosition = GUILayout.BeginScrollView(scrollPosition); #endif GUITools.Separator(); DrawSettingsHeader(); GUILayout.Space(5f); DrawIL2CPPSection(); EditorGUILayout.Space(); DrawInjectionSection(); EditorGUILayout.Space(); #if UNITY_2018_1_OR_NEWER DrawHashSection(); EditorGUILayout.Space(); #endif DrawWallHackSection(); EditorGUILayout.Space(); DrawConditionalSection(); #if !UNITY_2018_3_OR_NEWER GUILayout.EndScrollView(); #endif }
public static void OnGUI() { GUITools.Separator(); DrawSettingsHeader(); GUILayout.Space(5f); DrawIL2CPPSection(); EditorGUILayout.Space(); DrawInjectionSection(); EditorGUILayout.Space(); DrawHashSection(); EditorGUILayout.Space(); DrawWallHackSection(); EditorGUILayout.Space(); DrawConditionalSection(); }
private static void DrawConditionalSection() { var header = "Conditional Compilation Symbols"; if (EditorApplication.isCompiling) { var redColor = ColorTools.GetRedString(); header += " [<color=#" + redColor + ">compiling</color>]"; } using (var changed = new EditorGUI.ChangeCheckScope()) { var fold = GUITools.DrawFoldHeader(header, ACTkEditorPrefsSettings.ConditionalFoldout); if (changed.changed) { ACTkEditorPrefsSettings.ConditionalFoldout = fold; } } if (EditorApplication.isCompiling) { GUI.enabled = false; } if (!ACTkEditorPrefsSettings.ConditionalFoldout) { return; } GUILayout.Space(-3f); using (GUITools.Vertical(GUITools.PanelWithBackground)) { GUILayout.Label("Here you may switch conditional compilation symbols used in ACTk.\n" + "Check Readme for more details on each symbol.", EditorStyles.wordWrappedLabel); EditorGUILayout.Space(); if (symbolsData == null) { symbolsData = SettingsUtils.GetSymbolsData(); } /*if (GUILayout.Button("Reset")) * { * var groups = (BuildTargetGroup[])Enum.GetValues(typeof(BuildTargetGroup)); * foreach (BuildTargetGroup buildTargetGroup in groups) * { * PlayerSettings.SetScriptingDefineSymbolsForGroup(buildTargetGroup, string.Empty); * } * }*/ //using (GUITools.Horizontal()) GUILayout.Label("Debug Symbols", GUITools.LargeBoldLabel); GUITools.Separator(); DrawSymbol(ref symbolsData.injectionDebug, ACTkEditorConstants.Conditionals.InjectionDebug, "Switches the Injection Detector debug."); DrawSymbol(ref symbolsData.injectionDebugVerbose, ACTkEditorConstants.Conditionals.InjectionDebugVerbose, "Switches the Injection Detector verbose debug level."); DrawSymbol(ref symbolsData.injectionDebugParanoid, ACTkEditorConstants.Conditionals.InjectionDebugParanoid, "Switches the Injection Detector paranoid debug level."); DrawSymbol(ref symbolsData.wallhackDebug, ACTkEditorConstants.Conditionals.WallhackDebug, "Switches the WallHack Detector debug - you'll see the WallHack objects in scene and get extra information in console."); DrawSymbol(ref symbolsData.detectionBacklogs, ACTkEditorConstants.Conditionals.DetectionBacklogs, "Enables additional logs in some detectors to make it easier to debug false positives."); EditorGUILayout.Space(); GUILayout.Label("Compatibility Symbols", GUITools.LargeBoldLabel); GUITools.Separator(); DrawSymbol(ref symbolsData.exposeThirdPartyIntegration, ACTkEditorConstants.Conditionals.ThirdPartyIntegration, "Enable to let other third-party code in project know you have ACTk added."); DrawSymbol(ref symbolsData.excludeObfuscation, ACTkEditorConstants.Conditionals.ExcludeObfuscation, "Enable if you use Unity-unaware obfuscators which support ObfuscationAttribute to help avoid names corruption."); DrawSymbol(ref symbolsData.preventReadPhoneState, ACTkEditorConstants.Conditionals.PreventReadPhoneState, "Disables ObscuredPrefs Lock To Device functionality."); DrawSymbol(ref symbolsData.preventInternetPermission, ACTkEditorConstants.Conditionals.PreventInternetPermission, "Disables TimeCheatingDetector functionality."); DrawSymbol(ref symbolsData.obscuredAutoMigration, ACTkEditorConstants.Conditionals.ObscuredAutoMigration, "Enables automatic migration of ObscuredFloat and ObscuredDouble instances from the ACTk 1.5.2.0-1.5.8.0 to the 1.5.9.0+ format. Reduces these types performance a bit."); DrawSymbol(ref symbolsData.usExportCompatible, ACTkEditorConstants.Conditionals.UsExportCompatible, "Enables US Encryption Export Regulations compatibility mode so ACTk do not force you to declare you're using encryption when publishing your application to the Apple App Store."); GUILayout.Space(3); } GUI.enabled = true; }
protected void DrawRecord(int recordIndex, out bool recordRemoved) { recordRemoved = false; var record = filteredRecords[recordIndex]; GUITools.Separator(); using (GUITools.Horizontal(GUITools.PanelWithBackground)) { if (GUILayout.Button(new GUIContent("X", "Delete this pref."), GUITools.CompactButton, GUILayout.Width(20))) { record.Delete(); allRecords.Remove(record); filteredRecords.Remove(record); recordRemoved = true; return; } GUI.enabled = (record.dirtyValue || record.dirtyKey) && record.prefType != PrefsRecord.PrefsType.Unknown; if (GUILayout.Button(new GUIContent("S", "Save changes in this pref."), GUITools.CompactButton, GUILayout.Width(20))) { record.Save(); GUIUtility.keyboardControl = 0; } GUI.enabled = record.prefType != PrefsRecord.PrefsType.Unknown; if (record.Obscured) { GUI.enabled &= record.obscuredType == ObscuredPrefs.DataType.String || record.obscuredType == ObscuredPrefs.DataType.Int || record.obscuredType == ObscuredPrefs.DataType.Float; if (GUILayout.Button(new GUIContent("D", "Decrypt this pref using ObscuredPrefs"), GUITools.CompactButton, GUILayout.Width(25))) { record.Decrypt(); GUIUtility.keyboardControl = 0; } } else { if (GUILayout.Button(new GUIContent("E", "Encrypt this pref using ObscuredPrefs"), GUITools.CompactButton, GUILayout.Width(25))) { record.Encrypt(); GUIUtility.keyboardControl = 0; } } GUI.enabled = true; if (GUILayout.Button(new GUIContent("...", "Other operations"), GUITools.CompactButton, GUILayout.Width(25))) { ShowOtherMenu(record); } var guiColor = GUI.color; if (record.Obscured) { GUI.color = obscuredColor; } GUI.enabled = record.prefType != PrefsRecord.PrefsType.Unknown; if (record.Obscured && !(record.obscuredType == ObscuredPrefs.DataType.String || record.obscuredType == ObscuredPrefs.DataType.Int || record.obscuredType == ObscuredPrefs.DataType.Float)) { GUI.enabled = false; EditorGUILayout.TextField(record.Key, GUILayout.MaxWidth(200), GUILayout.MinWidth(50)); GUI.enabled = record.prefType != PrefsRecord.PrefsType.Unknown; } else { record.Key = EditorGUILayout.TextField(record.Key, GUILayout.MaxWidth(200), GUILayout.MinWidth(50)); } if ((record.prefType == PrefsRecord.PrefsType.String && !record.Obscured) || (record.Obscured && record.obscuredType == ObscuredPrefs.DataType.String)) { // to avoid TextMeshGenerator error because of too much characters if (record.StringValue.Length > 16382) { GUI.enabled = false; EditorGUILayout.TextField(StringTooLong, GUILayout.MinWidth(150)); GUI.enabled = record.prefType != PrefsRecord.PrefsType.Unknown; } else { record.StringValue = EditorGUILayout.TextField(record.StringValue, GUILayout.MinWidth(150)); } } else if (record.prefType == PrefsRecord.PrefsType.Int || (record.Obscured && record.obscuredType == ObscuredPrefs.DataType.Int)) { record.IntValue = EditorGUILayout.IntField(record.IntValue, GUILayout.MinWidth(150)); } else if (record.prefType == PrefsRecord.PrefsType.Float || (record.Obscured && record.obscuredType == ObscuredPrefs.DataType.Float)) { record.FloatValue = EditorGUILayout.FloatField(record.FloatValue, GUILayout.MinWidth(150)); } else if (record.Obscured) { GUI.enabled = false; EditorGUILayout.TextField(UnsupportedValueDescription, GUILayout.MinWidth(150)); GUI.enabled = record.prefType != PrefsRecord.PrefsType.Unknown; } else { GUI.enabled = false; EditorGUILayout.TextField(UnknownValueDescription, GUILayout.MinWidth(150)); GUI.enabled = record.prefType != PrefsRecord.PrefsType.Unknown; } GUI.color = guiColor; GUI.enabled = true; EditorGUILayout.LabelField(record.DisplayType, GUILayout.Width(70)); } }