예제 #1
0
    private static void SelectTypesFields()
    {
        List <string> selectTypes = CodeGuard.SelectTypes;

        for (int i = 0; i < CodeGuard.SelectTypesCount; i++)
        {
            selectTypes[i] = EditorGUILayout.TextField("Select Type " + (i + 1).ToString() + ":", selectTypes[i]);
        }
        CodeGuard.SaveSelectTypes();
    }
예제 #2
0
    private static void AssembliesSettingFields()
    {
        List <string> assembliesSettingList = CodeGuard.AssembliesSettingList;

        for (int i = 0; i < CodeGuard.AssembliesSettingCount; i++)
        {
            assembliesSettingList[i] = EditorGUILayout.TextField("Assembly " + (i + 1).ToString() + ":",
                                                                 assembliesSettingList[i]);
        }
        CodeGuard.SaveAssembliesSetting();
    }
예제 #3
0
    private static void ExcludedMethodsFields()
    {
        List <string> excludedMethods = CodeGuard.ExcludedMethods;

        for (int i = 0; i < CodeGuard.ExcludedMethodsCount; i++)
        {
            excludedMethods[i] = EditorGUILayout.TextField("Excluded Method Name " + (i + 1).ToString() + ":",
                                                           excludedMethods[i]);
        }
        CodeGuard.SaveExcludedMethods();
    }
예제 #4
0
    private static void CodeGuardSetupProfile()
    {
        bool lowProfile          = EditorPrefs.GetBool(_projectName + "CodeGuard LowProfile", false);
        bool mediumProfile       = EditorPrefs.GetBool(_projectName + "CodeGuard MediumProfile", false);
        bool highProfile         = EditorPrefs.GetBool(_projectName + "CodeGuard HighProfile", false);
        bool aggressiveProfile   = EditorPrefs.GetBool(_projectName + "CodeGuard AggressiveProfile", false);
        bool unityPackageProfile = EditorPrefs.GetBool(_projectName + "CodeGuard WebPlayerProfile", false);
        bool plainProfile        = EditorPrefs.GetBool(_projectName + "CodeGuard PlainProfile", false);

        if (lowProfile || mediumProfile || highProfile || aggressiveProfile || plainProfile)
        {
            CodeGuard.PostBuildGuarding = true;
            if (lowProfile)
            {
                CodeGuard.SetProfile(1);
            }
            else if (mediumProfile)
            {
                CodeGuard.SetProfile(2);
            }
            else if (highProfile)
            {
                CodeGuard.SetProfile(3);
            }
            else if (aggressiveProfile)
            {
                CodeGuard.SetProfile(4);
            }
            else if (plainProfile)
            {
                CodeGuard.SetProfile(6);
            }
        }
        else if (unityPackageProfile)
        {
            CodeGuard.SetProfile(5);
        }
        else
        {
            CodeGuard.PostBuildGuarding = false;
            CodeGuard.SetProfile(0);
        }

        if (_window)
        {
            _window.Repaint();
        }
    }
예제 #5
0
    private static void CodeGuardFolder()
    {
        string assemblyPath;

        if (Application.platform == RuntimePlatform.OSXEditor)
        {
            assemblyPath = EditorUtility.OpenFilePanel("Unity Project Application", Application.dataPath,
                                                       Path.GetDirectoryName(Application.dataPath));
        }
        else
        {
            assemblyPath = EditorUtility.OpenFolderPanel("Unity Project Assemblies", Application.dataPath, "Managed");
        }

        if (string.IsNullOrEmpty(assemblyPath) || !Directory.Exists(assemblyPath))
        {
            Debug.LogError("CodeGuard: Couldn't find Unity Project assemblies.");
            return;
        }

        string dirName = Path.GetFileName(assemblyPath);

        if (dirName != "Managed")
        {
            if (dirName.EndsWith("_Data"))
            {
                assemblyPath = assemblyPath + Path.DirectorySeparatorChar + "Managed";
            }
            else if (dirName.EndsWith(".app"))
            {
                assemblyPath += Path.DirectorySeparatorChar + "Contents" + Path.DirectorySeparatorChar + "Data" +
                                Path.DirectorySeparatorChar + "Managed";
            }
        }

        if (string.IsNullOrEmpty(assemblyPath) || !Directory.Exists(assemblyPath))
        {
            Debug.LogError("CodeGuard: Couldn't find Unity Project assemblies.");
            return;
        }

        CodeGuard.DoCodeGuardFolder(assemblyPath, true);
    }
예제 #6
0
 protected StateMachineBase(IStateMachineState initialState)
 {
     CodeGuard.ArgumentNotNull(initialState, nameof(initialState));
     this.CurrentState = initialState;
 }