コード例 #1
0
 public void UseRegular()
 {
     useRegular = true;
     healthBar += Random.Range(-10f, 50f);
     obscuredHealthBar = 11;
     Debug.Log("Try to change this float in memory:\n" + healthBar);
 }
コード例 #2
0
	private void Start()
	{
		Debug.Log("===== ObscuredFloatTest =====\n");

		// example of custom crypto key using
		// this is not necessary! key is 230887 by default
		ObscuredFloat.SetNewCryptoKey(404);

		// just a small self-test here
		healthBar = 99.9f;
		Debug.Log("Original health bar:\n" + healthBar);

		obscuredHealthBar = healthBar;
		Debug.Log("How your health bar is stored in memory when obscured:\n" + obscuredHealthBar.GetEncrypted());

		float totalProgress = 100f;
		ObscuredFloat currentProgress = 60.3f;
		ObscuredFloat.SetNewCryptoKey(666); // you can change crypto key at any time!

		// all usual operations supported, dummy code, just for demo purposes
		currentProgress ++;
		currentProgress -= 2;
		currentProgress --;
		currentProgress = totalProgress - currentProgress;

		obscuredHealthBar = healthBar = currentProgress = 0;
	}
コード例 #3
0
	public void UseObscured()
	{
		useRegular = false;
		obscuredHealthBar += Random.Range(-10f, 50f);
		healthBar = 11f;
		Debug.Log("Try to change this float in memory:\n" + obscuredHealthBar);
	}
コード例 #4
0
    void Start()
    {
        Debug.Log("===== ObscuredFloatTest =====\n");

        // example of custom crypto key using
        // this is not necessary! key is 230887 by default
        ObscuredFloat.SetNewCryptoKey(404);

        // just a small self-test here
        healthBar = 99.9f;
        Debug.Log("Original health bar:\n" + healthBar);

        obscuredHealthBar = healthBar;
        Debug.Log("How your health bar is stored in memory when obscured:\n" + obscuredHealthBar.GetEncrypted());

        float totalProgress = 100f;
        ObscuredFloat currentProgress = 60.3f;
        ObscuredFloat.SetNewCryptoKey(666); // you can change crypto key at any time!
        float progressLeft = totalProgress - currentProgress;
        Debug.Log("Level progress: " + currentProgress + "%, until finish: " + progressLeft + "%");

        obscuredHealthBar = healthBar = 0;
    }
コード例 #5
0
        public override void OnGUI(Rect position, SerializedProperty prop, GUIContent label)
        {
            var hiddenValue = prop.FindPropertyRelative("hiddenValue");

            var hiddenValueOldProperty = prop.FindPropertyRelative("hiddenValueOldByte4");
            var hiddenValueOld         = default(ACTkByte4);
            var oldValueExists         = false;

            if (hiddenValueOldProperty != null)
            {
                if (hiddenValueOldProperty.FindPropertyRelative("b1") != null)
                {
                    hiddenValueOld.b1 = (byte)hiddenValueOldProperty.FindPropertyRelative("b1").intValue;
                    hiddenValueOld.b2 = (byte)hiddenValueOldProperty.FindPropertyRelative("b2").intValue;
                    hiddenValueOld.b3 = (byte)hiddenValueOldProperty.FindPropertyRelative("b3").intValue;
                    hiddenValueOld.b4 = (byte)hiddenValueOldProperty.FindPropertyRelative("b4").intValue;

                    if (hiddenValueOld.b1 != 0 ||
                        hiddenValueOld.b2 != 0 ||
                        hiddenValueOld.b3 != 0 ||
                        hiddenValueOld.b4 != 0)
                    {
                        oldValueExists = true;
                    }
                }
            }

            SetBoldIfValueOverridePrefab(prop, hiddenValue);

            var cryptoKey       = prop.FindPropertyRelative("currentCryptoKey");
            var inited          = prop.FindPropertyRelative("inited");
            var fakeValue       = prop.FindPropertyRelative("fakeValue");
            var fakeValueActive = prop.FindPropertyRelative("fakeValueActive");

            var currentCryptoKey = cryptoKey.intValue;

            var   union = new IntBytesUnion();
            float val   = 0;

            if (!inited.boolValue)
            {
                if (currentCryptoKey == 0)
                {
                    currentCryptoKey = cryptoKey.intValue = ObscuredFloat.cryptoKeyEditor;
                }

                inited.boolValue = true;

                union.i = ObscuredFloat.Encrypt(0, currentCryptoKey);
                hiddenValue.intValue = union.i;
            }
            else
            {
                if (oldValueExists)
                {
                    union.b4 = hiddenValueOld;
                    union.b4.Shuffle();
                }
                else
                {
                    union.i = hiddenValue.intValue;
                }

                val = ObscuredFloat.Decrypt(union.i, currentCryptoKey);
            }

            EditorGUI.BeginChangeCheck();
            val = EditorGUI.FloatField(position, label, val);
            if (EditorGUI.EndChangeCheck())
            {
                union.i = ObscuredFloat.Encrypt(val, currentCryptoKey);
                hiddenValue.intValue = union.i;

                if (oldValueExists)
                {
                    hiddenValueOldProperty.FindPropertyRelative("b1").intValue = 0;
                    hiddenValueOldProperty.FindPropertyRelative("b2").intValue = 0;
                    hiddenValueOldProperty.FindPropertyRelative("b3").intValue = 0;
                    hiddenValueOldProperty.FindPropertyRelative("b4").intValue = 0;
                }

                fakeValue.floatValue      = val;
                fakeValueActive.boolValue = true;
            }

            ResetBoldFont();
        }
コード例 #6
0
        public static void MigrateObscuredTypesOnPrefabs()
        {
            if (!EditorUtility.DisplayDialog("ACTk Obscured types migration",
                                             "Are you sure you wish to scan all prefabs in your project and automatically migrate values to the new format?",
                                             "Yes", "No"))
            {
                Debug.Log(ActEditorGlobalStuff.LOG_PREFIX + "Obscured types migration was cancelled by user.");
                return;
            }

            AssetDatabase.SaveAssets();

            string[] assets = AssetDatabase.FindAssets("t:ScriptableObject t:Prefab");
            //string[] prefabs = AssetDatabase.FindAssets("TestPrefab");
            int touchedCount = 0;
            int count        = assets.Length;

            for (int i = 0; i < count; i++)
            {
                if (EditorUtility.DisplayCancelableProgressBar("Looking through objects", "Object " + (i + 1) + " from " + count,
                                                               i / (float)count))
                {
                    Debug.Log(ActEditorGlobalStuff.LOG_PREFIX + "Obscured types migration was cancelled by user.");
                    break;
                }

                string guid = assets[i];
                string path = AssetDatabase.GUIDToAssetPath(guid);

                Object[] objects = AssetDatabase.LoadAllAssetsAtPath(path);
                foreach (Object unityObject in objects)
                {
                    if (unityObject == null)
                    {
                        continue;
                    }
                    if (unityObject.name == "Deprecated EditorExtensionImpl")
                    {
                        continue;
                    }

                    bool modified         = false;
                    var  so               = new SerializedObject(unityObject);
                    SerializedProperty sp = so.GetIterator();

                    if (sp == null)
                    {
                        continue;
                    }

                    while (sp.NextVisible(true))
                    {
                        if (sp.propertyType != SerializedPropertyType.Generic)
                        {
                            continue;
                        }

                        string type = sp.type;

                        switch (type)
                        {
                        case "ObscuredBool":
                        {
                            SerializedProperty hiddenValue      = sp.FindPropertyRelative("hiddenValue");
                            SerializedProperty cryptoKey        = sp.FindPropertyRelative("currentCryptoKey");
                            SerializedProperty fakeValue        = sp.FindPropertyRelative("fakeValue");
                            SerializedProperty fakeValueChanged = sp.FindPropertyRelative("fakeValueChanged");
                            SerializedProperty fakeValueActive  = sp.FindPropertyRelative("fakeValueActive");
                            SerializedProperty inited           = sp.FindPropertyRelative("inited");

                            if (inited != null && inited.boolValue)
                            {
                                int  currentCryptoKey = cryptoKey.intValue;
                                bool real             = ObscuredBool.Decrypt(hiddenValue.intValue, (byte)currentCryptoKey);
                                bool fake             = fakeValue.boolValue;

                                if (real != fake)
                                {
                                    Debug.Log(ActEditorGlobalStuff.LOG_PREFIX + "Fixed property " + sp.displayName + ":" + type +
                                              " at the object " + unityObject.name + "\n" + path);
                                    fakeValue.boolValue = real;
                                    if (fakeValueChanged != null)
                                    {
                                        fakeValueChanged.boolValue = true;
                                    }
                                    if (fakeValueActive != null)
                                    {
                                        fakeValueActive.boolValue = true;
                                    }
                                    modified = true;
                                }
                            }
                        }
                        break;

                        case "ObscuredDouble":
                        {
                            SerializedProperty hiddenValue = sp.FindPropertyRelative("hiddenValue");
                            if (hiddenValue == null)
                            {
                                continue;
                            }

                            SerializedProperty hiddenValue1 = hiddenValue.FindPropertyRelative("b1");
                            SerializedProperty hiddenValue2 = hiddenValue.FindPropertyRelative("b2");
                            SerializedProperty hiddenValue3 = hiddenValue.FindPropertyRelative("b3");
                            SerializedProperty hiddenValue4 = hiddenValue.FindPropertyRelative("b4");
                            SerializedProperty hiddenValue5 = hiddenValue.FindPropertyRelative("b5");
                            SerializedProperty hiddenValue6 = hiddenValue.FindPropertyRelative("b6");
                            SerializedProperty hiddenValue7 = hiddenValue.FindPropertyRelative("b7");
                            SerializedProperty hiddenValue8 = hiddenValue.FindPropertyRelative("b8");

                            SerializedProperty hiddenValueOld = sp.FindPropertyRelative("hiddenValueOld");

                            if (hiddenValueOld != null && hiddenValueOld.isArray && hiddenValueOld.arraySize == 8)
                            {
                                hiddenValue1.intValue = hiddenValueOld.GetArrayElementAtIndex(0).intValue;
                                hiddenValue2.intValue = hiddenValueOld.GetArrayElementAtIndex(1).intValue;
                                hiddenValue3.intValue = hiddenValueOld.GetArrayElementAtIndex(2).intValue;
                                hiddenValue4.intValue = hiddenValueOld.GetArrayElementAtIndex(3).intValue;
                                hiddenValue5.intValue = hiddenValueOld.GetArrayElementAtIndex(4).intValue;
                                hiddenValue6.intValue = hiddenValueOld.GetArrayElementAtIndex(5).intValue;
                                hiddenValue7.intValue = hiddenValueOld.GetArrayElementAtIndex(6).intValue;
                                hiddenValue8.intValue = hiddenValueOld.GetArrayElementAtIndex(7).intValue;

                                hiddenValueOld.arraySize = 0;

                                Debug.Log(ActEditorGlobalStuff.LOG_PREFIX + "Migrated property " + sp.displayName + ":" + type +
                                          " at the object " + unityObject.name + "\n" + path);
                                modified = true;
                            }

#if UNITY_5_0_PLUS
                            SerializedProperty cryptoKey       = sp.FindPropertyRelative("currentCryptoKey");
                            SerializedProperty fakeValue       = sp.FindPropertyRelative("fakeValue");
                            SerializedProperty fakeValueActive = sp.FindPropertyRelative("fakeValueActive");
                            SerializedProperty inited          = sp.FindPropertyRelative("inited");

                            if (inited != null && inited.boolValue)
                            {
                                var union = new LongBytesUnion();
                                union.b8.b1 = (byte)hiddenValue1.intValue;
                                union.b8.b2 = (byte)hiddenValue2.intValue;
                                union.b8.b3 = (byte)hiddenValue3.intValue;
                                union.b8.b4 = (byte)hiddenValue4.intValue;
                                union.b8.b5 = (byte)hiddenValue5.intValue;
                                union.b8.b6 = (byte)hiddenValue6.intValue;
                                union.b8.b7 = (byte)hiddenValue7.intValue;
                                union.b8.b8 = (byte)hiddenValue8.intValue;

                                long   currentCryptoKey = cryptoKey.longValue;
                                double real             = ObscuredDouble.Decrypt(union.l, currentCryptoKey);
                                double fake             = fakeValue.doubleValue;

                                if (Math.Abs(real - fake) > 0.0000001d)
                                {
                                    Debug.Log(ActEditorGlobalStuff.LOG_PREFIX + "Fixed property " + sp.displayName + ":" + type +
                                              " at the object " + unityObject.name + "\n" + path);

                                    fakeValue.doubleValue     = real;
                                    fakeValueActive.boolValue = true;
                                    modified = true;
                                }
                            }
#endif
                        }
                        break;

                        case "ObscuredFloat":
                        {
                            SerializedProperty hiddenValue = sp.FindPropertyRelative("hiddenValue");
                            if (hiddenValue == null)
                            {
                                continue;
                            }

                            SerializedProperty hiddenValue1 = hiddenValue.FindPropertyRelative("b1");
                            SerializedProperty hiddenValue2 = hiddenValue.FindPropertyRelative("b2");
                            SerializedProperty hiddenValue3 = hiddenValue.FindPropertyRelative("b3");
                            SerializedProperty hiddenValue4 = hiddenValue.FindPropertyRelative("b4");

                            SerializedProperty hiddenValueOld = sp.FindPropertyRelative("hiddenValueOld");

                            if (hiddenValueOld != null && hiddenValueOld.isArray && hiddenValueOld.arraySize == 4)
                            {
                                hiddenValue1.intValue = hiddenValueOld.GetArrayElementAtIndex(0).intValue;
                                hiddenValue2.intValue = hiddenValueOld.GetArrayElementAtIndex(1).intValue;
                                hiddenValue3.intValue = hiddenValueOld.GetArrayElementAtIndex(2).intValue;
                                hiddenValue4.intValue = hiddenValueOld.GetArrayElementAtIndex(3).intValue;

                                hiddenValueOld.arraySize = 0;

                                Debug.Log(ActEditorGlobalStuff.LOG_PREFIX + "Migrated property " + sp.displayName + ":" + type +
                                          " at the object " + unityObject.name + "\n" + path);
                                modified = true;
                            }

                            SerializedProperty cryptoKey       = sp.FindPropertyRelative("currentCryptoKey");
                            SerializedProperty fakeValue       = sp.FindPropertyRelative("fakeValue");
                            SerializedProperty fakeValueActive = sp.FindPropertyRelative("fakeValueActive");
                            SerializedProperty inited          = sp.FindPropertyRelative("inited");

                            if (inited != null && inited.boolValue)
                            {
                                var union = new IntBytesUnion();
                                union.b4.b1 = (byte)hiddenValue1.intValue;
                                union.b4.b2 = (byte)hiddenValue2.intValue;
                                union.b4.b3 = (byte)hiddenValue3.intValue;
                                union.b4.b4 = (byte)hiddenValue4.intValue;

                                int   currentCryptoKey = cryptoKey.intValue;
                                float real             = ObscuredFloat.Decrypt(union.i, currentCryptoKey);
                                float fake             = fakeValue.floatValue;
                                if (Math.Abs(real - fake) > 0.0000001f)
                                {
                                    Debug.Log(ActEditorGlobalStuff.LOG_PREFIX + "Fixed property " + sp.displayName + ":" + type +
                                              " at the object " + unityObject.name + "\n" + path);

                                    fakeValue.floatValue      = real;
                                    fakeValueActive.boolValue = true;
                                    modified = true;
                                }
                            }
                        }
                        break;

                        case "ObscuredInt":
                        {
                            SerializedProperty hiddenValue     = sp.FindPropertyRelative("hiddenValue");
                            SerializedProperty cryptoKey       = sp.FindPropertyRelative("currentCryptoKey");
                            SerializedProperty fakeValue       = sp.FindPropertyRelative("fakeValue");
                            SerializedProperty fakeValueActive = sp.FindPropertyRelative("fakeValueActive");
                            SerializedProperty inited          = sp.FindPropertyRelative("inited");

                            if (inited != null && inited.boolValue)
                            {
                                int currentCryptoKey = cryptoKey.intValue;
                                int real             = ObscuredInt.Decrypt(hiddenValue.intValue, currentCryptoKey);
                                int fake             = fakeValue.intValue;

                                if (real != fake)
                                {
                                    Debug.Log(ActEditorGlobalStuff.LOG_PREFIX + "Fixed property " + sp.displayName + ":" + type +
                                              " at the object " + unityObject.name + "\n" + path);
                                    fakeValue.intValue        = real;
                                    fakeValueActive.boolValue = true;
                                    modified = true;
                                }
                            }
                        }
                        break;

#if UNITY_5_0_PLUS
                        case "ObscuredLong":
                        {
                            SerializedProperty hiddenValue     = sp.FindPropertyRelative("hiddenValue");
                            SerializedProperty cryptoKey       = sp.FindPropertyRelative("currentCryptoKey");
                            SerializedProperty fakeValue       = sp.FindPropertyRelative("fakeValue");
                            SerializedProperty fakeValueActive = sp.FindPropertyRelative("fakeValueActive");
                            SerializedProperty inited          = sp.FindPropertyRelative("inited");

                            if (inited != null && inited.boolValue)
                            {
                                long currentCryptoKey = cryptoKey.longValue;
                                long real             = ObscuredLong.Decrypt(hiddenValue.longValue, currentCryptoKey);
                                long fake             = fakeValue.longValue;

                                if (real != fake)
                                {
                                    Debug.Log(ActEditorGlobalStuff.LOG_PREFIX + "Fixed property " + sp.displayName + ":" + type +
                                              " at the object " + unityObject.name + "\n" + path);
                                    fakeValue.longValue       = real;
                                    fakeValueActive.boolValue = true;
                                    modified = true;
                                }
                            }
                        }
                        break;

                        case "ObscuredShort":
                        {
                            SerializedProperty hiddenValue     = sp.FindPropertyRelative("hiddenValue");
                            SerializedProperty cryptoKey       = sp.FindPropertyRelative("currentCryptoKey");
                            SerializedProperty fakeValue       = sp.FindPropertyRelative("fakeValue");
                            SerializedProperty fakeValueActive = sp.FindPropertyRelative("fakeValueActive");
                            SerializedProperty inited          = sp.FindPropertyRelative("inited");

                            if (inited != null && inited.boolValue)
                            {
                                short currentCryptoKey = (short)cryptoKey.intValue;
                                short real             = ObscuredShort.EncryptDecrypt((short)hiddenValue.intValue, currentCryptoKey);
                                short fake             = (short)fakeValue.intValue;

                                if (real != fake)
                                {
                                    Debug.Log(ActEditorGlobalStuff.LOG_PREFIX + "Fixed property " + sp.displayName + ":" + type +
                                              " at the object " + unityObject.name + "\n" + path);
                                    fakeValue.intValue        = real;
                                    fakeValueActive.boolValue = true;
                                    modified = true;
                                }
                            }
                        }
                        break;
#endif
                        case "ObscuredString":
                        {
                            SerializedProperty hiddenValue     = sp.FindPropertyRelative("hiddenValue");
                            SerializedProperty cryptoKey       = sp.FindPropertyRelative("currentCryptoKey");
                            SerializedProperty fakeValue       = sp.FindPropertyRelative("fakeValue");
                            SerializedProperty fakeValueActive = sp.FindPropertyRelative("fakeValueActive");
                            SerializedProperty inited          = sp.FindPropertyRelative("inited");

                            if (inited != null && inited.boolValue)
                            {
                                string currentCryptoKey = cryptoKey.stringValue;
                                byte[] bytes            = new byte[hiddenValue.arraySize];
                                for (int j = 0; j < hiddenValue.arraySize; j++)
                                {
                                    bytes[j] = (byte)hiddenValue.GetArrayElementAtIndex(j).intValue;
                                }

                                string real = ObscuredString.EncryptDecrypt(GetString(bytes), currentCryptoKey);
                                string fake = fakeValue.stringValue;

                                if (real != fake)
                                {
                                    Debug.Log(ActEditorGlobalStuff.LOG_PREFIX + "Fixed property " + sp.displayName + ":" + type +
                                              " at the object " + unityObject.name + "\n" + path);
                                    fakeValue.stringValue     = real;
                                    fakeValueActive.boolValue = true;
                                    modified = true;
                                }
                            }
                        }
                        break;

#if UNITY_5_0_PLUS
                        case "ObscuredUInt":
                        {
                            SerializedProperty hiddenValue     = sp.FindPropertyRelative("hiddenValue");
                            SerializedProperty cryptoKey       = sp.FindPropertyRelative("currentCryptoKey");
                            SerializedProperty fakeValue       = sp.FindPropertyRelative("fakeValue");
                            SerializedProperty fakeValueActive = sp.FindPropertyRelative("fakeValueActive");
                            SerializedProperty inited          = sp.FindPropertyRelative("inited");

                            if (inited != null && inited.boolValue)
                            {
                                uint currentCryptoKey = (uint)cryptoKey.intValue;
                                uint real             = ObscuredUInt.Decrypt((uint)hiddenValue.intValue, currentCryptoKey);
                                uint fake             = (uint)fakeValue.intValue;

                                if (real != fake)
                                {
                                    Debug.Log(ActEditorGlobalStuff.LOG_PREFIX + "Fixed property " + sp.displayName + ":" + type +
                                              " at the object " + unityObject.name + "\n" + path);
                                    fakeValue.intValue        = (int)real;
                                    fakeValueActive.boolValue = true;
                                    modified = true;
                                }
                            }
                        }
                        break;

                        case "ObscuredULong":
                        {
                            SerializedProperty hiddenValue     = sp.FindPropertyRelative("hiddenValue");
                            SerializedProperty cryptoKey       = sp.FindPropertyRelative("currentCryptoKey");
                            SerializedProperty fakeValue       = sp.FindPropertyRelative("fakeValue");
                            SerializedProperty fakeValueActive = sp.FindPropertyRelative("fakeValueActive");
                            SerializedProperty inited          = sp.FindPropertyRelative("inited");

                            if (inited != null && inited.boolValue)
                            {
                                ulong currentCryptoKey = (ulong)cryptoKey.longValue;
                                ulong real             = ObscuredULong.Decrypt((ulong)hiddenValue.longValue, currentCryptoKey);
                                ulong fake             = (ulong)fakeValue.longValue;

                                if (real != fake)
                                {
                                    Debug.Log(ActEditorGlobalStuff.LOG_PREFIX + "Fixed property " + sp.displayName + ":" + type +
                                              " at the object " + unityObject.name + "\n" + path);
                                    fakeValue.longValue       = (long)real;
                                    fakeValueActive.boolValue = true;
                                    modified = true;
                                }
                            }
                        }
                        break;
#endif
                        case "ObscuredVector2":
                        {
                            SerializedProperty hiddenValue = sp.FindPropertyRelative("hiddenValue");
                            if (hiddenValue == null)
                            {
                                continue;
                            }

                            SerializedProperty hiddenValueX = hiddenValue.FindPropertyRelative("x");
                            SerializedProperty hiddenValueY = hiddenValue.FindPropertyRelative("y");

                            SerializedProperty cryptoKey       = sp.FindPropertyRelative("currentCryptoKey");
                            SerializedProperty fakeValue       = sp.FindPropertyRelative("fakeValue");
                            SerializedProperty fakeValueActive = sp.FindPropertyRelative("fakeValueActive");
                            SerializedProperty inited          = sp.FindPropertyRelative("inited");

                            if (inited != null && inited.boolValue)
                            {
                                ObscuredVector2.RawEncryptedVector2 ev = new ObscuredVector2.RawEncryptedVector2();
                                ev.x = hiddenValueX.intValue;
                                ev.y = hiddenValueY.intValue;

                                int     currentCryptoKey = cryptoKey.intValue;
                                Vector2 real             = ObscuredVector2.Decrypt(ev, currentCryptoKey);
                                Vector2 fake             = fakeValue.vector2Value;

                                if (real != fake)
                                {
                                    Debug.Log(ActEditorGlobalStuff.LOG_PREFIX + "Fixed property " + sp.displayName + ":" + type +
                                              " at the object " + unityObject.name + "\n" + path);
                                    fakeValue.vector2Value    = real;
                                    fakeValueActive.boolValue = true;
                                    modified = true;
                                }
                            }
                        }
                        break;

                        case "ObscuredVector3":
                        {
                            SerializedProperty hiddenValue = sp.FindPropertyRelative("hiddenValue");
                            if (hiddenValue == null)
                            {
                                continue;
                            }

                            SerializedProperty hiddenValueX = hiddenValue.FindPropertyRelative("x");
                            SerializedProperty hiddenValueY = hiddenValue.FindPropertyRelative("y");
                            SerializedProperty hiddenValueZ = hiddenValue.FindPropertyRelative("z");

                            SerializedProperty cryptoKey       = sp.FindPropertyRelative("currentCryptoKey");
                            SerializedProperty fakeValue       = sp.FindPropertyRelative("fakeValue");
                            SerializedProperty fakeValueActive = sp.FindPropertyRelative("fakeValueActive");
                            SerializedProperty inited          = sp.FindPropertyRelative("inited");

                            if (inited != null && inited.boolValue)
                            {
                                var ev = new ObscuredVector3.RawEncryptedVector3();
                                ev.x = hiddenValueX.intValue;
                                ev.y = hiddenValueY.intValue;
                                ev.z = hiddenValueZ.intValue;

                                int     currentCryptoKey = cryptoKey.intValue;
                                Vector3 real             = ObscuredVector3.Decrypt(ev, currentCryptoKey);
                                Vector3 fake             = fakeValue.vector3Value;

                                if (real != fake)
                                {
                                    Debug.Log(ActEditorGlobalStuff.LOG_PREFIX + "Fixed property " + sp.displayName + ":" + type +
                                              " at the object " + unityObject.name + "\n" + path);
                                    fakeValue.vector3Value    = real;
                                    fakeValueActive.boolValue = true;
                                    modified = true;
                                }
                            }
                        }
                        break;
                        }
                    }

                    if (modified)
                    {
                        touchedCount++;
                        so.ApplyModifiedProperties();
                        EditorUtility.SetDirty(unityObject);
                    }
                }
            }

            AssetDatabase.SaveAssets();

            EditorUtility.ClearProgressBar();

            if (touchedCount > 0)
            {
                Debug.Log(ActEditorGlobalStuff.LOG_PREFIX + "Migrated obscured types on " + touchedCount + " objects.");
            }
            else
            {
                Debug.Log(ActEditorGlobalStuff.LOG_PREFIX + "No objects were found for obscured types migration.");
            }
        }
コード例 #7
0
ファイル: UIAdAlarmController.cs プロジェクト: TimonYoon/Dev
    void InitCoolTime()
    {
        string key = "";

        //무스트 시작 시간
        key = "FreeHeroStartTime";
        if (ObscuredPrefs.HasKey(key))
        {
            string s = ObscuredPrefs.GetString(key);
            if (!string.IsNullOrEmpty(s))
            {
                DateTime.TryParse(s, out _freeHeroStartTime);
                Debug.Log("공짜 영웅 획득 시간 : " + freeHeroStartTime);
            }
        }

        key = "FreeHeroRemainTime";
        if (ObscuredPrefs.HasKey(key))
        {
            freeHeroRemainTime = ObscuredPrefs.GetFloat(key);
        }


        float c = constFreeHeroCoolTime - (float)(DateTime.Now - freeHeroStartTime).TotalSeconds;

        if (c < 0f)
        {
            c = 0f;
        }

        Instance.StartCoroutine(ApplyFreeHeroCoolTime(c));

        //무스트 시작 시간
        key = "FreeRubyStartTime";
        if (ObscuredPrefs.HasKey(key))
        {
            string s = ObscuredPrefs.GetString(key);
            if (!string.IsNullOrEmpty(s))
            {
                DateTime.TryParse(s, out _freeRubyStartTime);
                Debug.Log("공짜 루비 획득 시간 : " + freeRubyStartTime);
            }
        }

        key = "FreeRubyRemainTime";
        if (ObscuredPrefs.HasKey(key))
        {
            freeRubyRemainTime = ObscuredPrefs.GetFloat(key);
        }

        c = constFreeRubyCoolTime - (float)(DateTime.Now - freeRubyStartTime).TotalSeconds;

        if (c < 0f)
        {
            c = 0f;
        }

        Instance.StartCoroutine(ApplyFreeRubyCoolTime(c));


        //무스트 시작 시간
        key = "FreeBoostStartTime";
        if (ObscuredPrefs.HasKey(key))
        {
            string s = ObscuredPrefs.GetString(key);
            if (!string.IsNullOrEmpty(s))
            {
                DateTime.TryParse(s, out _freeBoostStartTime);
                Debug.Log("공짜 2배부스트 획득 시간 : " + freeBoostStartTime);
            }
        }

        key = "FreeBoostRemainTime";
        if (ObscuredPrefs.HasKey(key))
        {
            freeBoostRemainTime = ObscuredPrefs.GetFloat(key);
        }

        c = constFreeBoostCoolTime - (float)(DateTime.Now - freeBoostStartTime).TotalSeconds;

        if (c < 0f)
        {
            c = 0f;
        }

        Instance.StartCoroutine(ApplyFreeBoostCoolTime(c));
    }
コード例 #8
0
        public override void OnGUI(Rect position, SerializedProperty prop, GUIContent label)
        {
            SerializedProperty hiddenValue = prop.FindPropertyRelative("hiddenValue");

            SetBoldIfValueOverridePrefab(prop, hiddenValue);

            SerializedProperty cryptoKey = prop.FindPropertyRelative("currentCryptoKey");
            SerializedProperty fakeValue = prop.FindPropertyRelative("fakeValue");
            SerializedProperty inited    = prop.FindPropertyRelative("inited");

            int currentCryptoKey = cryptoKey.intValue;

            IntBytesUnion union = new IntBytesUnion();
            float         val   = 0;

            if (!inited.boolValue)
            {
                if (currentCryptoKey == 0)
                {
                    currentCryptoKey = cryptoKey.intValue = ObscuredFloat.cryptoKeyEditor;
                }
                hiddenValue.arraySize = 4;
                inited.boolValue      = true;

                union.i = ObscuredFloat.Encrypt(0, currentCryptoKey);

                hiddenValue.GetArrayElementAtIndex(0).intValue = union.b1;
                hiddenValue.GetArrayElementAtIndex(1).intValue = union.b2;
                hiddenValue.GetArrayElementAtIndex(2).intValue = union.b3;
                hiddenValue.GetArrayElementAtIndex(3).intValue = union.b4;
            }
            else
            {
                int    arraySize        = hiddenValue.arraySize;
                byte[] hiddenValueArray = new byte[arraySize];
                for (int i = 0; i < arraySize; i++)
                {
                    hiddenValueArray[i] = (byte)hiddenValue.GetArrayElementAtIndex(i).intValue;
                }

                union.b1 = hiddenValueArray[0];
                union.b2 = hiddenValueArray[1];
                union.b3 = hiddenValueArray[2];
                union.b4 = hiddenValueArray[3];

                val = ObscuredFloat.Decrypt(union.i, currentCryptoKey);
            }

            EditorGUI.BeginChangeCheck();
            val = EditorGUI.FloatField(position, label, val);
            if (EditorGUI.EndChangeCheck())
            {
                union.i = ObscuredFloat.Encrypt(val, currentCryptoKey);

                hiddenValue.GetArrayElementAtIndex(0).intValue = union.b1;
                hiddenValue.GetArrayElementAtIndex(1).intValue = union.b2;
                hiddenValue.GetArrayElementAtIndex(2).intValue = union.b3;
                hiddenValue.GetArrayElementAtIndex(3).intValue = union.b4;
            }

            fakeValue.floatValue = val;
        }
コード例 #9
0
 public static void SetBaldPlayingTime(ObscuredFloat playCount)
 {
     mBaldPlayingTime = playCount;
 }
コード例 #10
0
        public void CheckFinalPin()
        {
            if (0f < this.finalPinCoolTime)
            {
                return;
            }
            float tensionRate = this.nowTensionValue / this.G_MAX_TENSION;

            this.tbFinalPinInfo = TableData.Instance.GetTbFinalPinInfo(this.inGame.tbStage.FinalFinGroupMatch, tensionRate);
            BF_Enum.eFinalPinResult result = (BF_Enum.eFinalPinResult) this.tbFinalPinInfo.Result;
            if (result != BF_Enum.eFinalPinResult.None)
            {
                this.nowTensionValue -= this.nowTensionValue * this.tbFinalPinInfo.TensionDecRate;
                this.finalPinCoolTime = this.tbFinalPinInfo.CoolTime;
                this.SetActiveFinalPinMoveEffect(true);
                this.SetFinalPinColor(150f, 100f, 100f);
                ObscuredFloat value         = this.inGame.fish.GetNormalDamage();
                ObscuredFloat obscuredFloat = value * this.tbFinalPinInfo.PinDamageMultiple;
                if (this.tbFinalPinInfo.Result == 1)
                {
                    this.SetComboCount(0);
                    BF_Singleton <BF_Sound> .Instance.PlayEffect(BF_Enum.eSound.FX_UI_Pin_Miss);
                }
                else if (this.tbFinalPinInfo.Result == 3)
                {
                    BF_Singleton <BF_Sound> .Instance.PlayEffect(BF_Enum.eSound.FX_UI_Pin_Perfect);

                    BF_Camera.Instance.SetImpactShake(0.3f);
                    this.AddComboCount();
                    tb_FinalPinCombo tbFinalPinCombo = TableData.Instance.GetTbFinalPinCombo(this.comboCount);
                    float            tbStackBoostInfoDamageIncRate = TableData.Instance.GetTbStackBoostInfoDamageIncRate(this.damageLineStackCount);
                    obscuredFloat            *= 1f + tbFinalPinCombo.FinalPinDamageInc + tbStackBoostInfoDamageIncRate;
                    this.finalPinResetTime    = (float)tbFinalPinCombo.FinalPinResetTime;
                    this.maxFinalPinResetTime = this.finalPinResetTime;
                    this.SetDamageLineStackCount(0);
                    this.SetFinalPinResetTimeBar(0f, true);
                    this.finalPinEffect.PlayTouchEffect();
                }
                else
                {
                    BF_Singleton <BF_Sound> .Instance.PlayEffect(BF_Enum.eSound.FX_UI_Pin_Cool);
                }
                if (0f < obscuredFloat)
                {
                    ObscuredFloat value2 = this.inGame.GetTotalPlayerAbility(BF_Enum.eAbilityType.FinalPinDamageInc);
                    ObscuredFloat value3 = BF_Singleton <BF_DataManager> .Instance.fishData.GetTotalFishAbility(BF_Enum.eFishAbilityType.FinalPinDamageDec);

                    ObscuredFloat value4 = BF_Singleton <BF_DataManager> .Instance.fishEventData.GetFishEventAbility(BF_Enum.eFishAbilityType.FinalPinDamageDec);

                    obscuredFloat = obscuredFloat * (1f + value2) * (1f - value3 * (1f + value4));
                    this.inGame.fishInfo.SetDamageEffect(this.inGame.fish.maxHp, (int)obscuredFloat, 0, true);
                    this.inGame.fish.addHp = obscuredFloat;
                    ObscuredFloat obscuredFloat2 = this.inGame.fish.maxHp * BF_Singleton_MonoBehaviour <BF_App> .Instance.GetGlobal(BF_Enum.eGlobal.LIMIT_MAX_FISH_DAMAGE);

                    if (obscuredFloat2 < this.inGame.fish.addHp)
                    {
                        this.inGame.fish.addHp = obscuredFloat2;
                    }
                    FF_Fish fish = this.inGame.fish;
                    fish.addHp *= -1f;
                    this.inGame.fish.tempAddHp = this.inGame.fish.addHp;
                    this.inGame.fish.AddFishHpNew();
                    FF_InGame_Ui ff_InGame_Ui = this.inGame;
                    ff_InGame_Ui.tempTotalFishDamage -= this.inGame.fish.tempAddHp;
                }
                this.SetFinalPinResult((BF_Enum.eFinalPinResult) this.tbFinalPinInfo.Result);
            }
        }
コード例 #11
0
 public void ResetTime()
 {
     _timeSec = limitTime;
 }
    public void SetPlayerInfo(ObscuredFloat shieldDuration, Sprite[] sprite, ObscuredInt slotAmount, ObscuredFloat lifeTime)
    {
        //Debug.Log("Get Amounts : " + shieldDuration + ", " + slotAmount + ", " + lifeTime);
        shieldDuration = (shieldDuration < 0) ? 0 : shieldDuration;
        slotAmount     = (slotAmount < 0) ? 0 : (int)slotAmount;
        lifeTime       = (lifeTime < 1) ? 1 : lifeTime;
        //Debug.Log("Get Amounts : " + shieldDuration + ", " + slotAmount + ", " + lifeTime);

        playerStatus.shieldDuration = shieldDuration;

        spriteBodyRenderer.sprite = sprite[0];

        playerSprites = sprite;
        playerStatusManager.CreateItemSlots(slotAmount);
        playerTimeBar.InitTimeBar(lifeTime, OnGameOver);
    }
コード例 #13
0
        public override void OnGUI(Rect position, SerializedProperty prop, GUIContent label)
        {
            SerializedProperty hiddenValue  = prop.FindPropertyRelative("hiddenValue");
            SerializedProperty hiddenValue1 = hiddenValue.FindPropertyRelative("b1");
            SerializedProperty hiddenValue2 = hiddenValue.FindPropertyRelative("b2");
            SerializedProperty hiddenValue3 = hiddenValue.FindPropertyRelative("b3");
            SerializedProperty hiddenValue4 = hiddenValue.FindPropertyRelative("b4");

            SerializedProperty hiddenValueOld  = prop.FindPropertyRelative("hiddenValueOld");
            SerializedProperty hiddenValueOld1 = null;
            SerializedProperty hiddenValueOld2 = null;
            SerializedProperty hiddenValueOld3 = null;
            SerializedProperty hiddenValueOld4 = null;

            if (hiddenValueOld != null && hiddenValueOld.isArray && hiddenValueOld.arraySize == 4)
            {
                hiddenValueOld1 = hiddenValueOld.GetArrayElementAtIndex(0);
                hiddenValueOld2 = hiddenValueOld.GetArrayElementAtIndex(1);
                hiddenValueOld3 = hiddenValueOld.GetArrayElementAtIndex(2);
                hiddenValueOld4 = hiddenValueOld.GetArrayElementAtIndex(3);
            }

            SetBoldIfValueOverridePrefab(prop, hiddenValue);

            SerializedProperty cryptoKey = prop.FindPropertyRelative("currentCryptoKey");
            SerializedProperty fakeValue = prop.FindPropertyRelative("fakeValue");
            SerializedProperty inited    = prop.FindPropertyRelative("inited");

            int currentCryptoKey = cryptoKey.intValue;

            IntBytesUnion union = new IntBytesUnion();
            float         val   = 0;

            if (!inited.boolValue)
            {
                if (currentCryptoKey == 0)
                {
                    currentCryptoKey = cryptoKey.intValue = ObscuredFloat.cryptoKeyEditor;
                }
                inited.boolValue = true;

                union.i = ObscuredFloat.Encrypt(0, currentCryptoKey);

                hiddenValue1.intValue = union.b4.b1;
                hiddenValue2.intValue = union.b4.b2;
                hiddenValue3.intValue = union.b4.b3;
                hiddenValue4.intValue = union.b4.b4;
            }
            else
            {
                if (hiddenValueOld != null && hiddenValueOld.isArray && hiddenValueOld.arraySize == 4)
                {
                    union.b4.b1 = (byte)hiddenValueOld1.intValue;
                    union.b4.b2 = (byte)hiddenValueOld2.intValue;
                    union.b4.b3 = (byte)hiddenValueOld3.intValue;
                    union.b4.b4 = (byte)hiddenValueOld4.intValue;
                }
                else
                {
                    union.b4.b1 = (byte)hiddenValue1.intValue;
                    union.b4.b2 = (byte)hiddenValue2.intValue;
                    union.b4.b3 = (byte)hiddenValue3.intValue;
                    union.b4.b4 = (byte)hiddenValue4.intValue;
                }

                /*Debug.Log("Int: " + union.i);*/
                val = ObscuredFloat.Decrypt(union.i, currentCryptoKey);
            }

            EditorGUI.BeginChangeCheck();
            val = EditorGUI.FloatField(position, label, val);
            if (EditorGUI.EndChangeCheck())
            {
                union.i = ObscuredFloat.Encrypt(val, currentCryptoKey);

                hiddenValue1.intValue = union.b4.b1;
                hiddenValue2.intValue = union.b4.b2;
                hiddenValue3.intValue = union.b4.b3;
                hiddenValue4.intValue = union.b4.b4;

                if (hiddenValueOld != null && hiddenValueOld.isArray && hiddenValueOld.arraySize == 4)
                {
                    hiddenValueOld.arraySize = 0;
                }
            }

            fakeValue.floatValue = val;
            ResetBoldFont();
        }
コード例 #14
0
    /// <summary> 광고 보기, 버프 구매 할 때 증가. 광고보기 부스트는 15분, 루비 상품은 30분 </summary> <param name="boostMode"></param> <param name="coolTime"></param>
    static public void ApplyBoost(float speed, float coolTime = constBoostDoubleSpeedCoolTime)
    {
        if (speed == 3f)
        {
            coolTime = constBoostTripleSpeedCoolTime;
        }

        //속도에 따라서
        if (boostSpeed == speed)
        {
            boostRemainTime = boostRemainTime + coolTime;
            boostStartTime  = DateTime.Now;
        }
        else if (boostSpeed < speed && boostSpeed > 1f)
        {
            ObscuredPrefs.SetFloat("afterBoostSpeed", boostSpeed);
            ObscuredPrefs.SetFloat("afterBoostRemainTime", boostRemainTime);

            boostStartTime  = DateTime.Now;
            boostRemainTime = coolTime;
            boostSpeed      = speed;
        }
        else if (boostSpeed > speed && speed > 1f)
        {
            UIPopupManager.ShowOKPopup("부스트 저장", "현재보다 낮은 부스트는 현재 부스트가 끝나고 적용됩니다\n(이미 저장된 부스트가 있다면 추가로 저장됩니다)", null);

            if (ObscuredPrefs.HasKey("afterBoostSpeed"))
            {
                float tempRemainTime = ObscuredPrefs.GetFloat("afterBoostRemainTime");
                tempRemainTime += coolTime;
                ObscuredPrefs.SetFloat("afterBoostRemainTime", tempRemainTime);
            }
            else
            {
                ObscuredPrefs.SetFloat("afterBoostSpeed", speed);
                ObscuredPrefs.SetFloat("afterBoostRemainTime", coolTime);
            }

            return;
        }
        else
        {
            boostStartTime  = DateTime.Now;
            boostRemainTime = coolTime;
            boostSpeed      = speed;
        }


        ObscuredPrefs.SetFloat("boostSpeed", boostSpeed);
        ObscuredPrefs.SetString("boostStartTime", boostStartTime.ToString());
        ObscuredPrefs.SetFloat("boostRemainTime", boostRemainTime);
        ObscuredPrefs.Save();

        //남은 시간 갱신 로직
        if (coroutineBoostCoolTime != null)
        {
            Instance.StopCoroutine(coroutineBoostCoolTime);
            coroutineBoostCoolTime = null;
        }

        coroutineBoostCoolTime = Instance.StartCoroutine(ApplyBoostCoolTime(boostRemainTime));

        if (UIBoostTimer.Instance)
        {
            UIBoostTimer.Instance.StartBoostTimer();
        }
    }
コード例 #15
0
    /// <summary>
    /// this method applies a preset onto the passed component,
    /// returning true on success
    /// </summary>
    public static bool Apply(vp_Component component, vp_ComponentPreset preset)
    {
        if (preset == null)
        {
            Error("Tried to apply a preset that was null in '" + vp_Utility.GetErrorLocation() + "'");
            return(false);
        }

        if (preset.m_ComponentType == null)
        {
            Error("Preset ComponentType was null in '" + vp_Utility.GetErrorLocation() + "'");
            return(false);
        }

        if (component == null)
        {
            UnityEngine.Debug.LogWarning("Warning: Component was null when attempting to apply preset in '" + vp_Utility.GetErrorLocation() + "'");
            return(false);
        }

        if (component.Type != preset.m_ComponentType)
        {
            string type = "a '" + preset.m_ComponentType + "' preset";
            if (preset.m_ComponentType == null)
            {
                type = "an unknown preset type";
            }
            Error("Applied " + type + " to a '" + component.Type.ToString() + "' component in '" + vp_Utility.GetErrorLocation() + "'");
            return(false);
        }

        // component and preset both seem ok, so set the preset fields
        // onto the component
        for (int p = 0; p < preset.m_Fields.Count; p++)
        {
            FieldInfo destField = FieldInfo.GetFieldFromHandle(preset.m_Fields[p].FieldHandle);
#if ANTICHEAT
            if ((destField.FieldType == typeof(ObscuredFloat)) && (preset.m_Fields[p].Args.GetType() == typeof(float)))
            {
                ObscuredFloat o = (float)preset.m_Fields[p].Args;
                destField.SetValue(component, o);
            }
            else if ((destField.FieldType == typeof(ObscuredVector3)) && (preset.m_Fields[p].Args.GetType() == typeof(Vector3)))
            {
                ObscuredVector3 o = (Vector3)preset.m_Fields[p].Args;
                destField.SetValue(component, o);
            }
            else if ((destField.FieldType == typeof(ObscuredVector2)) && (preset.m_Fields[p].Args.GetType() == typeof(Vector2)))
            {
                ObscuredVector2 o = (Vector2)preset.m_Fields[p].Args;
                destField.SetValue(component, o);
            }
            else if ((destField.FieldType == typeof(ObscuredInt)) && (preset.m_Fields[p].Args.GetType() == typeof(int)))
            {
                ObscuredInt o = (int)preset.m_Fields[p].Args;
                destField.SetValue(component, o);
            }
            else if ((destField.FieldType == typeof(ObscuredBool)) && (preset.m_Fields[p].Args.GetType() == typeof(bool)))
            {
                ObscuredBool o = (bool)preset.m_Fields[p].Args;
                destField.SetValue(component, o);
            }
            else if ((destField.FieldType == typeof(ObscuredString)) && (preset.m_Fields[p].Args.GetType() == typeof(string)))
            {
                ObscuredString o = (string)preset.m_Fields[p].Args;
                destField.SetValue(component, o);
            }
            else
#endif
            destField.SetValue(component, preset.m_Fields[p].Args);
        }

        return(true);
    }
コード例 #16
0
    /// <summary>
    /// saves every supported field of 'preset' to text at 'fullPath'
    /// </summary>
    public static string Save(vp_ComponentPreset savePreset, string fullPath, bool isDifference = false)
    {
        m_FullPath = fullPath;

        // if the targeted file already exists, we take a look
        // at it to see if it has the same type as 'component'

        // attempt to load target preset into memory, ignoring
        // load errors in the process
        bool logErrorState = LogErrors;

        LogErrors = false;
        vp_ComponentPreset preset = new vp_ComponentPreset();

        preset.LoadTextStream(m_FullPath);
        LogErrors = logErrorState;

        // if we got hold of a preset and a component type from
        // the file, confirm overwrite
        if (preset != null)
        {
            if (preset.m_ComponentType != null)
            {
                // warn user if the type is not same as the passed 'component'
                if (preset.ComponentType != savePreset.ComponentType)
                {
                    return("'" + ExtractFilenameFromPath(m_FullPath) + "' has the WRONG component type: " + preset.ComponentType.ToString() + ".\n\nDo you want to replace it with a " + savePreset.ComponentType.ToString() + "?");
                }
                // confirm that the user does in fact want to overwrite this file
                if (System.IO.File.Exists(m_FullPath))
                {
                    if (isDifference)
                    {
                        return("This will update '" + ExtractFilenameFromPath(m_FullPath) + "' with only the values modified since pressing Play or setting a state.\n\nContinue?");
                    }
                    else
                    {
                        return("'" + ExtractFilenameFromPath(m_FullPath) + "' already exists.\n\nDo you want to replace it?");
                    }
                }
            }
            // if we end up here there was a file but it didn't make sense, so confirm overwrite
            if (System.IO.File.Exists(m_FullPath))
            {
                return("'" + ExtractFilenameFromPath(m_FullPath) + "' has an UNKNOWN component type.\n\nDo you want to replace it?");
            }
        }

        // go ahead and save 'component' to the text file

        ClearTextFile();

        Append("///////////////////////////////////////////////////////////");
        Append("// Component Preset Script");
        Append("///////////////////////////////////////////////////////////\n");

        // append component type
        Append("ComponentType " + savePreset.ComponentType.Name);

        // scan component for all its fields. NOTE: any types
        // to be supported must be included here.

        string prefix;
        string value;

        foreach (Field f in savePreset.m_Fields)
        {
            prefix = "";
            value  = "";
            FieldInfo fi = FieldInfo.GetFieldFromHandle(f.FieldHandle);

            if (fi.FieldType == typeof(float))
            {
                value = String.Format("{0:0.#######}", ((float)f.Args));
            }

            else if (fi.FieldType == typeof(Vector4))
            {
                Vector4 val = ((Vector4)f.Args);
                value = String.Format("{0:0.#######}", val.x) + " " +
                        String.Format("{0:0.#######}", val.y) + " " +
                        String.Format("{0:0.#######}", val.z) + " " +
                        String.Format("{0:0.#######}", val.w);
            }
            else if (fi.FieldType == typeof(Vector3))
            {
                Vector3 val = ((Vector3)f.Args);
                value = String.Format("{0:0.#######}", val.x) + " " +
                        String.Format("{0:0.#######}", val.y) + " " +
                        String.Format("{0:0.#######}", val.z);
            }
            else if (fi.FieldType == typeof(Vector2))
            {
                Vector2 val = ((Vector2)f.Args);
                value = String.Format("{0:0.#######}", val.x) + " " +
                        String.Format("{0:0.#######}", val.y);
            }
            else if (fi.FieldType == typeof(int))
            {
                value = ((int)f.Args).ToString();
            }
            else if (fi.FieldType == typeof(bool))
            {
                value = ((bool)f.Args).ToString();
            }
            else if (fi.FieldType == typeof(string))
            {
                value = ((string)f.Args);
            }
#if ANTICHEAT
            else if (fi.FieldType == typeof(ObscuredFloat))
            {
                ObscuredFloat val = ((float)f.Args);
                value = String.Format("{0:0.#######}", val);
            }
            else if (fi.FieldType == typeof(ObscuredVector3))
            {
                ObscuredVector3 val = ((ObscuredVector3)f.Args);
                value = String.Format("{0:0.#######}", val.x) + " " +
                        String.Format("{0:0.#######}", val.y) + " " +
                        String.Format("{0:0.#######}", val.z);
            }
            else if (fi.FieldType == typeof(ObscuredVector2))
            {
                ObscuredVector2 val = ((ObscuredVector2)f.Args);
                value = String.Format("{0:0.#######}", val.x) + " " +
                        String.Format("{0:0.#######}", val.y);
            }
            else if (fi.FieldType == typeof(ObscuredInt))
            {
                ObscuredInt val = ((ObscuredInt)f.Args);
                value = val.ToString();
            }
            else if (fi.FieldType == typeof(ObscuredBool))
            {
                ObscuredBool val = ((ObscuredBool)f.Args);
                value = val.ToString();
            }
            else if (fi.FieldType == typeof(ObscuredString))
            {
                ObscuredString val = ((ObscuredString)f.Args);
                value = val.ToString();
            }
#endif
            else
            {
                prefix = "//";
                value  = "<NOTE: Type '" + fi.FieldType.Name.ToString() + "' can't be saved to preset.>";
            }

            // print field name and value to the text file
            if (!string.IsNullOrEmpty(value) && fi.Name != "Persist")
            {
                Append(prefix + fi.Name + " " + value);
            }
        }

        return(null);
    }
コード例 #17
0
    static IEnumerator ApplyBoostCoolTime(float coolTime = constBoostDoubleSpeedCoolTime)
    {
        //남은 시간 갱신
        boostRemainTime = coolTime;


        float startTime    = Time.unscaledTime;
        float lastSaveTime = Time.unscaledTime + 60f;

        float boostTime = coolTime + Time.unscaledTime;

        while (boostRemainTime > 0f)
        {
            boostRemainTime = boostTime - Time.unscaledTime;

            yield return(null);

            //5분 간격으로 부스트 남은 시간 저장
            if (Time.unscaledTime > lastSaveTime)
            {
                lastSaveTime = lastSaveTime + 60f;
                ObscuredPrefs.SetFloat("boostSpeed", boostSpeed);
                if (boostSpeed >= 3f)
                {
                    ObscuredPrefs.SetFloat("boostRemainTime", boostRemainTime);
                }
                ObscuredPrefs.Save();
            }
        }

        ObscuredPrefs.DeleteKey("boostStartTime");
        ObscuredPrefs.DeleteKey("boostSpeed");
        ObscuredPrefs.DeleteKey("boostRemainTime");
        ObscuredPrefs.Save();


        boostStartTime  = DateTime.MinValue;
        boostRemainTime = 0f;
        boostSpeed      = 1f;

        if (ObscuredPrefs.HasKey("afterBoostSpeed"))
        {
            boostSpeed      = ObscuredPrefs.GetFloat("afterBoostSpeed");
            boostStartTime  = DateTime.Now;
            boostRemainTime = ObscuredPrefs.GetFloat("afterBoostRemainTime");

            ObscuredPrefs.DeleteKey("afterBoostSpeed");
            ObscuredPrefs.DeleteKey("afterBoostRemainTime");

            ObscuredPrefs.SetFloat("boostSpeed", boostSpeed);
            ObscuredPrefs.SetString("boostStartTime", boostStartTime.ToString());
            ObscuredPrefs.SetFloat("boostRemainTime", boostRemainTime);
            ObscuredPrefs.Save();

            coroutineBoostCoolTime = Instance.StartCoroutine(ApplyBoostCoolTime(boostRemainTime));

            if (UIBoostTimer.Instance)
            {
                UIBoostTimer.Instance.StartBoostTimer();
            }

            yield break;
        }
        else
        {
            coroutineBoostCoolTime = null;

            yield break;
        }
    }
コード例 #18
0
ファイル: ActTesterGui.cs プロジェクト: kknet/EpicPuzzle
        private void OnGUI()
        {
            GUIStyle centeredStyle = new GUIStyle(GUI.skin.label);

            centeredStyle.alignment = TextAnchor.UpperCenter;

            GUILayout.BeginArea(new Rect(10, 5, Screen.width - 20, Screen.height - 10));

            GUILayout.Label("<color=\"#0287C8\"><b>Anti-Cheat Toolkit Sandbox</b></color>", centeredStyle);
            GUILayout.Label("Here you can overview common ACTk features and try to cheat something yourself.", centeredStyle);
            GUILayout.Space(5);

            currentTab = GUILayout.Toolbar(currentTab, tabs);

            if (currentTab == 0)
            {
                #region obscured types tab
                GUILayout.Label("ACTk offers own collection of the secure types to let you protect your variables from <b>ANY</b> memory hacking tools (Cheat Engine, ArtMoney, GameCIH, Game Guardian, etc.).");
                GUILayout.Space(5);
                using (new HorizontalLayout())
                {
                    GUILayout.Label("<b>Obscured types:</b>\n<color=\"#75C4EB\">" + GetAllSimpleObscuredTypes() + "</color>", GUILayout.MinWidth(130));
                    GUILayout.Space(10);
                    using (new VerticalLayout(GUI.skin.box))
                    {
                        GUILayout.Label("Below you can try to cheat few variables of the regular types and their obscured (secure) analogues (you may change initial values from Tester object inspector):");

                        #region string
                        GUILayout.Space(10);
                        using (new HorizontalLayout())
                        {
                            GUILayout.Label("<b>string:</b> " + regularString, GUILayout.Width(250));
                            if (GUILayout.Button("Add random value"))
                            {
                                regularString += (char)Random.Range(97, 122);
                            }
                            if (GUILayout.Button("Reset"))
                            {
                                regularString = "";
                            }
                        }

                        using (new HorizontalLayout())
                        {
                            GUILayout.Label("<b>ObscuredString:</b> " + obscuredString, GUILayout.Width(250));
                            if (GUILayout.Button("Add random value"))
                            {
                                obscuredString += (char)Random.Range(97, 122);
                            }
                            if (GUILayout.Button("Reset"))
                            {
                                obscuredString = "";
                            }
                        }
                        #endregion

                        #region int
                        GUILayout.Space(10);
                        using (new HorizontalLayout())
                        {
                            GUILayout.Label("<b>int:</b> " + regularInt, GUILayout.Width(250));
                            if (GUILayout.Button("Add random value"))
                            {
                                regularInt += Random.Range(1, 100);
                            }
                            if (GUILayout.Button("Reset"))
                            {
                                regularInt = 0;
                            }
                        }

                        using (new HorizontalLayout())
                        {
                            GUILayout.Label("<b>ObscuredInt:</b> " + obscuredInt, GUILayout.Width(250));
                            if (GUILayout.Button("Add random value"))
                            {
                                obscuredInt += Random.Range(1, 100);
                            }
                            if (GUILayout.Button("Reset"))
                            {
                                obscuredInt = 0;
                            }
                        }
                        #endregion

                        #region float
                        GUILayout.Space(10);
                        using (new HorizontalLayout())
                        {
                            GUILayout.Label("<b>float:</b> " + regularFloat, GUILayout.Width(250));
                            if (GUILayout.Button("Add random value"))
                            {
                                regularFloat += Random.Range(1f, 100f);
                            }
                            if (GUILayout.Button("Reset"))
                            {
                                regularFloat = 0;
                            }
                        }

                        using (new HorizontalLayout())
                        {
                            GUILayout.Label("<b>ObscuredFloat:</b> " + obscuredFloat, GUILayout.Width(250));
                            if (GUILayout.Button("Add random value"))
                            {
                                obscuredFloat += Random.Range(1f, 100f);
                            }
                            if (GUILayout.Button("Reset"))
                            {
                                obscuredFloat = 0;
                            }
                        }
                        #endregion

                        #region Vector3
                        GUILayout.Space(10);
                        using (new HorizontalLayout())
                        {
                            GUILayout.Label("<b>Vector3:</b> " + regularVector3, GUILayout.Width(250));
                            if (GUILayout.Button("Add random value"))
                            {
                                regularVector3 += Random.insideUnitSphere;
                            }
                            if (GUILayout.Button("Reset"))
                            {
                                regularVector3 = Vector3.zero;
                            }
                        }

                        using (new HorizontalLayout())
                        {
                            GUILayout.Label("<b>ObscuredVector3:</b> " + obscuredVector3, GUILayout.Width(250));
                            if (GUILayout.Button("Add random value"))
                            {
                                obscuredVector3 += Random.insideUnitSphere;
                            }
                            if (GUILayout.Button("Reset"))
                            {
                                obscuredVector3 = Vector3.zero;
                            }
                        }
                        #endregion
                    }
                }
                #endregion
            }
            else if (currentTab == 1)
            {
                #region obscured prefs tab
                GUILayout.Label("ACTk has secure layer for the PlayerPrefs: <color=\"#75C4EB\">ObscuredPrefs</color>. It protects data from view, detects any cheating attempts, optionally locks data to the current device and supports additional data types.");
                GUILayout.Space(5);
                using (new HorizontalLayout())
                {
                    GUILayout.Label("<b>Supported types:</b>\n" + GetAllObscuredPrefsDataTypes(), GUILayout.MinWidth(130));
                    using (new VerticalLayout(GUI.skin.box))
                    {
                        GUILayout.Label("Below you can try to cheat both regular PlayerPrefs and secure ObscuredPrefs:");
                        using (new VerticalLayout())
                        {
                            GUILayout.Label("<color=\"" + RED_COLOR + "\"><b>PlayerPrefs:</b></color>\neasy to cheat, only 3 supported types", centeredStyle);
                            GUILayout.Space(5);
                            if (string.IsNullOrEmpty(regularPrefs))
                            {
                                LoadRegularPrefs();
                            }
                            using (new HorizontalLayout())
                            {
                                GUILayout.Label(regularPrefs, GUILayout.Width(270));
                                using (new VerticalLayout())
                                {
                                    using (new HorizontalLayout())
                                    {
                                        if (GUILayout.Button("Save"))
                                        {
                                            SaveRegularPrefs();
                                        }
                                        if (GUILayout.Button("Load"))
                                        {
                                            LoadRegularPrefs();
                                        }
                                    }
                                    if (GUILayout.Button("Delete"))
                                    {
                                        DeleteRegularPrefs();
                                    }
                                }
                            }
                        }
                        GUILayout.Space(5);
                        using (new VerticalLayout())
                        {
                            GUILayout.Label("<color=\"" + GREEN_COLOR + "\"><b>ObscuredPrefs:</b></color>\nsecure, lot of additional types and extra options", centeredStyle);
                            GUILayout.Space(5);
                            if (string.IsNullOrEmpty(obscuredPrefs))
                            {
                                LoadObscuredPrefs();
                            }

                            using (new HorizontalLayout())
                            {
                                GUILayout.Label(obscuredPrefs, GUILayout.Width(270));
                                using (new VerticalLayout())
                                {
                                    using (new HorizontalLayout())
                                    {
                                        if (GUILayout.Button("Save"))
                                        {
                                            SaveObscuredPrefs();
                                        }
                                        if (GUILayout.Button("Load"))
                                        {
                                            LoadObscuredPrefs();
                                        }
                                    }
                                    if (GUILayout.Button("Delete"))
                                    {
                                        DeleteObscuredPrefs();
                                    }

                                    using (new HorizontalLayout())
                                    {
                                        GUILayout.Label("LockToDevice level");
                                        PlaceUrlButton(API_URL_LOCK_TO_DEVICE);
                                    }
                                    savesLock = GUILayout.SelectionGrid(savesLock, new[] { ObscuredPrefs.DeviceLockLevel.None.ToString(), ObscuredPrefs.DeviceLockLevel.Soft.ToString(), ObscuredPrefs.DeviceLockLevel.Strict.ToString() }, 3);
                                    ObscuredPrefs.lockToDevice = (ObscuredPrefs.DeviceLockLevel)savesLock;
                                    GUILayout.Space(5);
                                    using (new HorizontalLayout())
                                    {
                                        ObscuredPrefs.preservePlayerPrefs = GUILayout.Toggle(ObscuredPrefs.preservePlayerPrefs, "preservePlayerPrefs");
                                        PlaceUrlButton(API_URL_PRESERVE_PREFS);
                                    }
                                    using (new HorizontalLayout())
                                    {
                                        ObscuredPrefs.emergencyMode = GUILayout.Toggle(ObscuredPrefs.emergencyMode, "emergencyMode");
                                        PlaceUrlButton(API_URL_EMERGENCY_MODE);
                                    }
                                    using (new HorizontalLayout())
                                    {
                                        ObscuredPrefs.readForeignSaves = GUILayout.Toggle(ObscuredPrefs.readForeignSaves, "readForeignSaves");
                                        PlaceUrlButton(API_URL_READ_FOREIGN);
                                    }
#if UNITY_EDITOR
                                    using (new HorizontalLayout())
                                    {
                                        ObscuredPrefs.unobscuredMode = GUILayout.Toggle(ObscuredPrefs.unobscuredMode, "unobscuredMode");
                                        PlaceUrlButton(API_URL_UNOBSCURED_MODE);
                                    }
#endif
                                    GUILayout.Space(5);
                                    GUILayout.Label("<color=\"" + (savesAlterationDetected ? RED_COLOR : GREEN_COLOR) + "\">Saves modification detected: " + savesAlterationDetected + "</color>");
                                    GUILayout.Label("<color=\"" + (foreignSavesDetected ? RED_COLOR : GREEN_COLOR) + "\">Foreign saves detected: " + foreignSavesDetected + "</color>");
                                }
                            }
                        }
                        GUILayout.Space(5);
                        PlaceUrlButton(API_URL_PLAYER_PREFS, "Visit docs to see where PlayerPrefs are stored", -1);
                    }
                }
                #endregion
            }
            else
            {
                GUILayout.Label("ACTk is able to detect some types of cheating to let you take action on the cheating players. This example scene has all possible detectors and all of them are automatically start on scene start.");
                GUILayout.Space(5);
                using (new VerticalLayout(GUI.skin.box))
                {
                    GUILayout.Label("<b>" + SpeedHackDetector.COMPONENT_NAME + "</b>");
                    GUILayout.Label("Allows to detect Cheat Engine's speed hack (and maybe some other speed hack tools) usage.");
                    GUILayout.Label("<color=\"" + (speedHackDetected ? RED_COLOR : GREEN_COLOR) + "\">Detected: " + speedHackDetected.ToString().ToLower() + "</color>");
                    GUILayout.Space(10);
                    GUILayout.Label("<b>" + ObscuredCheatingDetector.COMPONENT_NAME + "</b>");
                    GUILayout.Label("Detects cheating of any Obscured type (except ObscuredPrefs, it has own detection features) used in project.");
                    GUILayout.Label("<color=\"" + (obscuredTypeCheatDetected ? RED_COLOR : GREEN_COLOR) + "\">Detected: " + obscuredTypeCheatDetected.ToString().ToLower() + "</color>");
                    GUILayout.Space(10);
                    GUILayout.Label("<b>" + WallHackDetector.COMPONENT_NAME + "</b>");
                    GUILayout.Label("Detects common types of wall hack cheating: walking through the walls (Rigidbody and CharacterController modules), shooting through the walls (Raycast module), looking through the walls (Wireframe module).");
                    GUILayout.Label("<color=\"" + (wallHackCheatDetected ? RED_COLOR : GREEN_COLOR) + "\">Detected: " + wallHackCheatDetected.ToString().ToLower() + "</color>");
                    GUILayout.Space(10);
                    GUILayout.Label("<b>" + InjectionDetector.COMPONENT_NAME + "</b>");
                    GUILayout.Label("Allows to detect foreign managed assemblies in your application.");
#if UNITY_STANDALONE || UNITY_WEBPLAYER || UNITY_ANDROID
                    GUILayout.Label("<color=\"" + (injectionDetected ? RED_COLOR : GREEN_COLOR) + "\">Detected: " + injectionDetected.ToString().ToLower() + "</color>");
#else
                    GUILayout.Label("Injection detection is not available on current platform");
#endif
                }
            }
            GUILayout.EndArea();
        }
コード例 #19
0
 private void Awake()
 {
     startTime = Time.time;
 }
コード例 #20
0
 private void Update()
 {
     existTime = Time.time - startTime;
 }
コード例 #21
0
        private void OnGUI()
        {
            GUIStyle gUIStyle = new GUIStyle(GUI.skin.label);

            gUIStyle.alignment = TextAnchor.UpperCenter;
            GUILayout.BeginArea(new Rect(10f, 5f, (float)(Screen.width - 20), (float)(Screen.height - 10)));
            GUILayout.Label("<color=\"#0287C8\"><b>Anti-Cheat Toolkit Sandbox</b></color>", gUIStyle, new GUILayoutOption[0]);
            GUILayout.Label("Here you can overview common ACTk features and try to cheat something yourself.", gUIStyle, new GUILayoutOption[0]);
            GUILayout.Space(5f);
            this.currentTab = GUILayout.Toolbar(this.currentTab, this.tabs, new GUILayoutOption[0]);
            if (this.currentTab == 0)
            {
                GUILayout.Label("ACTk offers own collection of the secure types to let you protect your variables from <b>ANY</b> memory hacking tools (Cheat Engine, ArtMoney, GameCIH, Game Guardian, etc.).", new GUILayoutOption[0]);
                GUILayout.Space(5f);
                using (new HorizontalLayout(new GUILayoutOption[0]))
                {
                    GUILayout.Label("<b>Obscured types:</b>\n<color=\"#75C4EB\">" + this.GetAllSimpleObscuredTypes() + "</color>", new GUILayoutOption[]
                    {
                        GUILayout.MinWidth(130f)
                    });
                    GUILayout.Space(10f);
                    using (new VerticalLayout(GUI.skin.box))
                    {
                        GUILayout.Label("Below you can try to cheat few variables of the regular types and their obscured (secure) analogues (you may change initial values from Tester object inspector):", new GUILayoutOption[0]);
                        GUILayout.Space(10f);
                        using (new HorizontalLayout(new GUILayoutOption[0]))
                        {
                            GUILayout.Label("<b>string:</b> " + this.regularString, new GUILayoutOption[]
                            {
                                GUILayout.Width(250f)
                            });
                            if (GUILayout.Button("Add random value", new GUILayoutOption[0]))
                            {
                                this.regularString += (char)UnityEngine.Random.Range(97, 122);
                            }
                            if (GUILayout.Button("Reset", new GUILayoutOption[0]))
                            {
                                this.regularString = string.Empty;
                            }
                        }
                        using (new HorizontalLayout(new GUILayoutOption[0]))
                        {
                            GUILayout.Label("<b>ObscuredString:</b> " + this.obscuredString, new GUILayoutOption[]
                            {
                                GUILayout.Width(250f)
                            });
                            if (GUILayout.Button("Add random value", new GUILayoutOption[0]))
                            {
                                this.obscuredString += (char)UnityEngine.Random.Range(97, 122);
                            }
                            if (GUILayout.Button("Reset", new GUILayoutOption[0]))
                            {
                                this.obscuredString = string.Empty;
                            }
                        }
                        GUILayout.Space(10f);
                        using (new HorizontalLayout(new GUILayoutOption[0]))
                        {
                            GUILayout.Label("<b>int:</b> " + this.regularInt, new GUILayoutOption[]
                            {
                                GUILayout.Width(250f)
                            });
                            if (GUILayout.Button("Add random value", new GUILayoutOption[0]))
                            {
                                this.regularInt += UnityEngine.Random.Range(1, 100);
                            }
                            if (GUILayout.Button("Reset", new GUILayoutOption[0]))
                            {
                                this.regularInt = 0;
                            }
                        }
                        using (new HorizontalLayout(new GUILayoutOption[0]))
                        {
                            GUILayout.Label("<b>ObscuredInt:</b> " + this.obscuredInt, new GUILayoutOption[]
                            {
                                GUILayout.Width(250f)
                            });
                            if (GUILayout.Button("Add random value", new GUILayoutOption[0]))
                            {
                                this.obscuredInt += UnityEngine.Random.Range(1, 100);
                            }
                            if (GUILayout.Button("Reset", new GUILayoutOption[0]))
                            {
                                this.obscuredInt = 0;
                            }
                        }
                        GUILayout.Space(10f);
                        using (new HorizontalLayout(new GUILayoutOption[0]))
                        {
                            GUILayout.Label("<b>float:</b> " + this.regularFloat, new GUILayoutOption[]
                            {
                                GUILayout.Width(250f)
                            });
                            if (GUILayout.Button("Add random value", new GUILayoutOption[0]))
                            {
                                this.regularFloat += UnityEngine.Random.Range(1f, 100f);
                            }
                            if (GUILayout.Button("Reset", new GUILayoutOption[0]))
                            {
                                this.regularFloat = 0f;
                            }
                        }
                        using (new HorizontalLayout(new GUILayoutOption[0]))
                        {
                            GUILayout.Label("<b>ObscuredFloat:</b> " + this.obscuredFloat, new GUILayoutOption[]
                            {
                                GUILayout.Width(250f)
                            });
                            if (GUILayout.Button("Add random value", new GUILayoutOption[0]))
                            {
                                this.obscuredFloat += UnityEngine.Random.Range(1f, 100f);
                            }
                            if (GUILayout.Button("Reset", new GUILayoutOption[0]))
                            {
                                this.obscuredFloat = 0f;
                            }
                        }
                        GUILayout.Space(10f);
                        using (new HorizontalLayout(new GUILayoutOption[0]))
                        {
                            GUILayout.Label("<b>Vector3:</b> " + this.regularVector3, new GUILayoutOption[]
                            {
                                GUILayout.Width(250f)
                            });
                            if (GUILayout.Button("Add random value", new GUILayoutOption[0]))
                            {
                                this.regularVector3 += UnityEngine.Random.insideUnitSphere;
                            }
                            if (GUILayout.Button("Reset", new GUILayoutOption[0]))
                            {
                                this.regularVector3 = Vector3.zero;
                            }
                        }
                        using (new HorizontalLayout(new GUILayoutOption[0]))
                        {
                            GUILayout.Label("<b>ObscuredVector3:</b> " + this.obscuredVector3, new GUILayoutOption[]
                            {
                                GUILayout.Width(250f)
                            });
                            if (GUILayout.Button("Add random value", new GUILayoutOption[0]))
                            {
                                this.obscuredVector3 += UnityEngine.Random.insideUnitSphere;
                            }
                            if (GUILayout.Button("Reset", new GUILayoutOption[0]))
                            {
                                this.obscuredVector3 = Vector3.zero;
                            }
                        }
                    }
                }
            }
            else if (this.currentTab == 1)
            {
                GUILayout.Label("ACTk has secure layer for the PlayerPrefs: <color=\"#75C4EB\">ObscuredPrefs</color>. It protects data from view, detects any cheating attempts, optionally locks data to the current device and supports additional data types.", new GUILayoutOption[0]);
                GUILayout.Space(5f);
                using (new HorizontalLayout(new GUILayoutOption[0]))
                {
                    GUILayout.Label("<b>Supported types:</b>\n" + this.GetAllObscuredPrefsDataTypes(), new GUILayoutOption[]
                    {
                        GUILayout.MinWidth(130f)
                    });
                    using (new VerticalLayout(GUI.skin.box))
                    {
                        GUILayout.Label("Below you can try to cheat both regular PlayerPrefs and secure ObscuredPrefs:", new GUILayoutOption[0]);
                        using (new VerticalLayout(new GUILayoutOption[0]))
                        {
                            GUILayout.Label("<color=\"#FF4040\"><b>PlayerPrefs:</b></color>\neasy to cheat, only 3 supported types", gUIStyle, new GUILayoutOption[0]);
                            GUILayout.Space(5f);
                            if (string.IsNullOrEmpty(this.regularPrefs))
                            {
                                this.LoadRegularPrefs();
                            }
                            using (new HorizontalLayout(new GUILayoutOption[0]))
                            {
                                GUILayout.Label(this.regularPrefs, new GUILayoutOption[]
                                {
                                    GUILayout.Width(270f)
                                });
                                using (new VerticalLayout(new GUILayoutOption[0]))
                                {
                                    using (new HorizontalLayout(new GUILayoutOption[0]))
                                    {
                                        if (GUILayout.Button("Save", new GUILayoutOption[0]))
                                        {
                                            this.SaveRegularPrefs();
                                        }
                                        if (GUILayout.Button("Load", new GUILayoutOption[0]))
                                        {
                                            this.LoadRegularPrefs();
                                        }
                                    }
                                    if (GUILayout.Button("Delete", new GUILayoutOption[0]))
                                    {
                                        this.DeleteRegularPrefs();
                                    }
                                }
                            }
                        }
                        GUILayout.Space(5f);
                        using (new VerticalLayout(new GUILayoutOption[0]))
                        {
                            GUILayout.Label("<color=\"#02C85F\"><b>ObscuredPrefs:</b></color>\nsecure, lot of additional types and extra options", gUIStyle, new GUILayoutOption[0]);
                            GUILayout.Space(5f);
                            if (string.IsNullOrEmpty(this.obscuredPrefs))
                            {
                                this.LoadObscuredPrefs();
                            }
                            using (new HorizontalLayout(new GUILayoutOption[0]))
                            {
                                GUILayout.Label(this.obscuredPrefs, new GUILayoutOption[]
                                {
                                    GUILayout.Width(270f)
                                });
                                using (new VerticalLayout(new GUILayoutOption[0]))
                                {
                                    using (new HorizontalLayout(new GUILayoutOption[0]))
                                    {
                                        if (GUILayout.Button("Save", new GUILayoutOption[0]))
                                        {
                                            this.SaveObscuredPrefs();
                                        }
                                        if (GUILayout.Button("Load", new GUILayoutOption[0]))
                                        {
                                            this.LoadObscuredPrefs();
                                        }
                                    }
                                    if (GUILayout.Button("Delete", new GUILayoutOption[0]))
                                    {
                                        this.DeleteObscuredPrefs();
                                    }
                                    using (new HorizontalLayout(new GUILayoutOption[0]))
                                    {
                                        GUILayout.Label("LockToDevice level", new GUILayoutOption[0]);
                                        this.PlaceUrlButton("http://j.mp/1gxg1tf");
                                    }
                                    this.savesLock = GUILayout.SelectionGrid(this.savesLock, new string[]
                                    {
                                        ObscuredPrefs.DeviceLockLevel.None.ToString(),
                                        ObscuredPrefs.DeviceLockLevel.Soft.ToString(),
                                        ObscuredPrefs.DeviceLockLevel.Strict.ToString()
                                    }, 3, new GUILayoutOption[0]);
                                    ObscuredPrefs.lockToDevice = (ObscuredPrefs.DeviceLockLevel) this.savesLock;
                                    GUILayout.Space(5f);
                                    using (new HorizontalLayout(new GUILayoutOption[0]))
                                    {
                                        ObscuredPrefs.preservePlayerPrefs = GUILayout.Toggle(ObscuredPrefs.preservePlayerPrefs, "preservePlayerPrefs", new GUILayoutOption[0]);
                                        this.PlaceUrlButton("http://j.mp/1iBK5pz");
                                    }
                                    using (new HorizontalLayout(new GUILayoutOption[0]))
                                    {
                                        ObscuredPrefs.emergencyMode = GUILayout.Toggle(ObscuredPrefs.emergencyMode, "emergencyMode", new GUILayoutOption[0]);
                                        this.PlaceUrlButton("http://j.mp/1FRAL5L");
                                    }
                                    using (new HorizontalLayout(new GUILayoutOption[0]))
                                    {
                                        ObscuredPrefs.readForeignSaves = GUILayout.Toggle(ObscuredPrefs.readForeignSaves, "readForeignSaves", new GUILayoutOption[0]);
                                        this.PlaceUrlButton("http://j.mp/1LCdpDa");
                                    }
                                    GUILayout.Space(5f);
                                    GUILayout.Label(string.Concat(new object[]
                                    {
                                        "<color=\"",
                                        (!this.savesAlterationDetected) ? "#02C85F" : "#FF4040",
                                        "\">Saves modification detected: ",
                                        this.savesAlterationDetected,
                                        "</color>"
                                    }), new GUILayoutOption[0]);
                                    GUILayout.Label(string.Concat(new object[]
                                    {
                                        "<color=\"",
                                        (!this.foreignSavesDetected) ? "#02C85F" : "#FF4040",
                                        "\">Foreign saves detected: ",
                                        this.foreignSavesDetected,
                                        "</color>"
                                    }), new GUILayoutOption[0]);
                                }
                            }
                        }
                        GUILayout.Space(5f);
                        this.PlaceUrlButton("http://docs.unity3d.com/ScriptReference/PlayerPrefs.html", "Visit docs to see where PlayerPrefs are stored", -1);
                    }
                }
            }
            else
            {
                GUILayout.Label("ACTk is able to detect some types of cheating to let you take action on the cheating players. This example scene has all possible detectors and all of them are automatically start on scene start.", new GUILayoutOption[0]);
                GUILayout.Space(5f);
                using (new VerticalLayout(GUI.skin.box))
                {
                    GUILayout.Label("<b>Speed Hack Detector</b>", new GUILayoutOption[0]);
                    GUILayout.Label("Allows to detect Cheat Engine's speed hack (and maybe some other speed hack tools) usage.", new GUILayoutOption[0]);
                    GUILayout.Label(string.Concat(new string[]
                    {
                        "<color=\"",
                        (!this.speedHackDetected) ? "#02C85F" : "#FF4040",
                        "\">Detected: ",
                        this.speedHackDetected.ToString().ToLower(),
                        "</color>"
                    }), new GUILayoutOption[0]);
                    GUILayout.Space(10f);
                    GUILayout.Label("<b>Obscured Cheating Detector</b>", new GUILayoutOption[0]);
                    GUILayout.Label("Detects cheating of any Obscured type (except ObscuredPrefs, it has own detection features) used in project.", new GUILayoutOption[0]);
                    GUILayout.Label(string.Concat(new string[]
                    {
                        "<color=\"",
                        (!this.obscuredTypeCheatDetected) ? "#02C85F" : "#FF4040",
                        "\">Detected: ",
                        this.obscuredTypeCheatDetected.ToString().ToLower(),
                        "</color>"
                    }), new GUILayoutOption[0]);
                    GUILayout.Space(10f);
                    GUILayout.Label("<b>WallHack Detector</b>", new GUILayoutOption[0]);
                    GUILayout.Label("Detects common types of wall hack cheating: walking through the walls (Rigidbody and CharacterController modules), shooting through the walls (Raycast module), looking through the walls (Wireframe module).", new GUILayoutOption[0]);
                    GUILayout.Label(string.Concat(new string[]
                    {
                        "<color=\"",
                        (!this.wallHackCheatDetected) ? "#02C85F" : "#FF4040",
                        "\">Detected: ",
                        this.wallHackCheatDetected.ToString().ToLower(),
                        "</color>"
                    }), new GUILayoutOption[0]);
                    GUILayout.Space(10f);
                    GUILayout.Label("<b>Injection Detector</b>", new GUILayoutOption[0]);
                    GUILayout.Label("Allows to detect foreign managed assemblies in your application.", new GUILayoutOption[0]);
                    GUILayout.Label(string.Concat(new string[]
                    {
                        "<color=\"",
                        (!this.injectionDetected) ? "#02C85F" : "#FF4040",
                        "\">Detected: ",
                        this.injectionDetected.ToString().ToLower(),
                        "</color>"
                    }), new GUILayoutOption[0]);
                }
            }
            GUILayout.EndArea();
        }