Exemplo n.º 1
0
 public void AutoCompileShaders()
 {
     if (_needCompile)
     {
         EchoPFXShaderBuild.BuildShaders(epfxm.ergList);
         _needCompile = false;
     }
 }
Exemplo n.º 2
0
    //=========================================================================
    public override void OnInspectorGUI()
    {
        string[] names = { "Group", "Build", "Make" };
        int      loop;
        Color    oldColor = GUI.color;
        string   cname;
        bool     oldToggle;

        serializedObject.Update();
//		postFX.Update();

        if (epfxm.ergList.Count > 0)
        {
            SetNewRenderGroup(epfxm.ergList[_ergIndex], false);
        }

        EditorGUILayout.Space();

        epfxm.managerCameraDepth = EditorGUILayout.FloatField("Manager Depth", epfxm.managerCameraDepth);
        epfxm.frameRate          = EditorGUILayout.IntField("Frame Rate", epfxm.frameRate);

        oldToggle  = _playMaker;
        _playMaker = EditorGUILayout.Toggle("PlayMaker Actions", _playMaker);
        if (oldToggle != _playMaker)
        {
            _playMaker = TogglePlayMakerActions();
        }

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Export"))
        {
            _customOpt = null;
            EchoPFXLoadSave.Save(epfxm);
        }
        if (GUILayout.Button("Import"))
        {
            _customOpt   = null;
            _needCompile = true;
            SetNewRenderGroup(EchoPFXLoadSave.Load(epfxm), false);
            EditorUtility.SetDirty(target);
        }
        GUILayout.EndHorizontal();


        EditorGUILayout.Space();
        GUILayout.Box("", new GUILayoutOption[] { GUILayout.ExpandWidth(true), GUILayout.Height(8) });
        EditorGUILayout.Space();

        _myrgFold = EditorGUILayout.Foldout(_myrgFold, new GUIContent("Render Groups"));
        if (_myrgFold)
        {
            MyRenderGroupsGUI();
        }

        EditorGUILayout.Space();

        EditorGUILayout.Space();
        GUILayout.Box("", new GUILayoutOption[] { GUILayout.ExpandWidth(true), GUILayout.Height(8) });
        EditorGUILayout.Space();

        _myfxFold = EditorGUILayout.Foldout(_myfxFold, new GUIContent("Post Effects"));

        if (_myfxFold)
        {
            MyEffectsGUI();
        }

        EditorGUILayout.Space();
        GUILayout.Box("", new GUILayoutOption[] { GUILayout.ExpandWidth(true), GUILayout.Height(8) });
        EditorGUILayout.Space();

        EditorGUILayout.Space();

        if (_needCompile)
        {
            cname     = ">> Compile Post FX Shaders <<";
            GUI.color = new Color(2.0f, 0.5f, 0.0f, 1.0f);
        }
        else
        {
            cname = "Compile Post FX Shaders";
        }

        if (GUILayout.Button(cname, GUILayout.Height(24)))
        {
            EchoPFXShaderBuild.BuildShaders(epfxm.ergList);
            _needCompile = false;
        }
        GUI.color = oldColor;

        EditorGUILayout.Space();
        GUILayout.Box("", new GUILayoutOption[] { GUILayout.ExpandWidth(true), GUILayout.Height(8) });

        EditorGUILayout.Space();

        GUILayout.BeginHorizontal();
        for (loop = 0; loop < 3; loop++)
        {
            if (loop == _curMode)
            {
                GUI.color = new Color(0.5f, 0.7f, 2.0f, 1.0f);
            }

            if (GUILayout.Button(names[loop]))
            {
                _customOpt = null;
                _curMode   = loop;
                epfxm.UpdateAllRenderGroups();
            }

            GUI.color = oldColor;
        }
        GUILayout.EndHorizontal();

        EditorGUILayout.Space();

        switch (_curMode)
        {
        case 1:
            EffectBuildOptionsGUI();
            break;

        case 2:
            EffectEditorGUI();
            break;

        default:
            RenderGroupGUI();
            break;
        }

        if (GUI.changed)
        {
            EditorUtility.SetDirty(target);
        }

        serializedObject.ApplyModifiedProperties();
    }