Example #1
0
    static void ImportEffectPack()
    {
        PKFxSettings.GetAllAssetPath();
        ImportPKFxListEditor window = ScriptableObject.CreateInstance(typeof(ImportPKFxListEditor)) as ImportPKFxListEditor;

        window.Paths = PKFxSettings.AssetPathList;
        window.ShowUtility();
    }
Example #2
0
    private void DisplayGeneralCategory()
    {
        GUIStyle boldStyleRed = new GUIStyle();

        boldStyleRed.fontStyle        = FontStyle.Bold;
        boldStyleRed.normal.textColor = Color.red;
        boldStyleRed.hover.textColor  = Color.red;

        EditorGUILayout.BeginHorizontal();
        PKFxSettings.TimeMultiplier = EditorGUILayout.Slider(timeMultiplierLabel, PKFxSettings.TimeMultiplier, 0.0f, 10.0f);
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        PKFxSettings.EnableFileLog = EditorGUILayout.ToggleLeft(enableFileLogLabel, PKFxSettings.EnableFileLog);
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        PKFxSettings.EnableRaycastForCollisions = EditorGUILayout.ToggleLeft(enableRaycastForCollisionsLabel, PKFxSettings.EnableRaycastForCollisions);
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();

        if (!string.IsNullOrEmpty(PKFxSettings.PopcornPackFxPath))
        {
            EditorGUILayout.LabelField(PKFxSettings.PopcornPackFxPath);
        }
        else
        {
            EditorGUILayout.LabelField("<empty>", boldStyleRed);
        }
        if (GUILayout.Button("Set Pack Fx Path"))
        {
            string path = EditorUtility.OpenFolderPanel("Choose PopcornFx Asset Folder", "", "");
            if (Directory.Exists(path))
            {
                var fileUri      = new Uri(path);
                var referenceUri = new Uri(Application.dataPath);
                PKFxSettings.PopcornPackFxPath = referenceUri.MakeRelativeUri(fileUri).ToString();
            }
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        if (!string.IsNullOrEmpty(PKFxSettings.UnityPackFxPath))
        {
            EditorGUILayout.LabelField(PKFxSettings.UnityPackFxPath);
        }
        else
        {
            EditorGUILayout.LabelField("<empty>", boldStyleRed);
        }

        if (GUILayout.Button("Set Unity Fx Path"))
        {
            string path = EditorUtility.OpenFolderPanel("Choose Unity Fx Assets Folder", "Resources", "");
            if (Directory.Exists(path))
            {
                PKFxSettings.UnityPackFxPath = path.Substring(Application.dataPath.Length);
            }
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Reimport Pack");
        if (GUILayout.Button("Choose files"))
        {
            PKFxSettings.GetAllAssetPath();
            ImportPKFxListEditor window = ScriptableObject.CreateInstance(typeof(ImportPKFxListEditor)) as ImportPKFxListEditor;
            window.Paths = PKFxSettings.AssetPathList;
            window.ShowUtility();
        }
        if (GUILayout.Button("All"))
        {
            PKFxSettings.ReimportAllAssets();
        }
        EditorGUILayout.EndHorizontal();
    }