示例#1
0
        public void OnGUI(PaintJob[] jobs)
        {
            var window = VertexPainterWindow.GetWindow <VertexPainterWindow>();

            window.brushMode = (VertexPainterWindow.BrushTarget)EditorGUILayout.EnumPopup("Target Channel", window.brushMode);
            aoOneMinusColor  = EditorGUILayout.Toggle("Color Inverse (1-v)", aoOneMinusColor);
            aoSamples        = EditorGUILayout.IntSlider("Samples", aoSamples, 64, 1024);
            EditorGUILayout.BeginHorizontal();
            aoRange   = EditorGUILayout.Vector2Field("Range (Min, Max)", aoRange);
            aoRange.x = Mathf.Max(aoRange.x, 0.0001f);
            EditorGUILayout.EndHorizontal();
            aoIntensity  = EditorGUILayout.Slider("Intensity", aoIntensity, 0.25f, 4.0f);
            bakeLighting = EditorGUILayout.Toggle("Bake Lighting", bakeLighting);
            if (bakeLighting)
            {
                aoLightAmbient = EditorGUILayout.ColorField("Light Ambient", aoLightAmbient);
            }
            aoBakeMode = (AOBakeMode)EditorGUILayout.EnumPopup("Mode", aoBakeMode);
            //aoColliderList = EditorGUILayout.ObjectField(aoColliderList);
            EditorGUILayout.LabelField("Colliders: " + aoColliderList.Count.ToString());
            foreach (var go in aoColliderList)
            {
                EditorGUILayout.ObjectField("", go, typeof(GameObject), false);
            }
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("Add Selected Object"))
            {
                aoColliderList.AddRange(Selection.gameObjects);
            }
            if (GUILayout.Button("Clear"))
            {
                aoColliderList.Clear();
            }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();
            if (GUILayout.Button("Bake"))
            {
                DoBakeAO(jobs, window);
            }
        }
示例#2
0
        public void OnGUI(PaintJob[] jobs)
        {
            var window = VertexPainterWindow.GetWindow <VertexPainterWindow>();

            window.brushMode = (VertexPainterWindow.BrushTarget)EditorGUILayout.EnumPopup("Target Channel", window.brushMode);
            aoSamples        = EditorGUILayout.IntSlider("Samples", aoSamples, 64, 1024);
            EditorGUILayout.BeginHorizontal();
            aoRange   = EditorGUILayout.Vector2Field("Range (Min, Max)", aoRange);
            aoRange.x = Mathf.Max(aoRange.x, 0.0001f);
            EditorGUILayout.EndHorizontal();
            aoIntensity  = EditorGUILayout.Slider("Intensity", aoIntensity, 0.25f, 4.0f);
            bakeLighting = EditorGUILayout.Toggle("Bake Lighting", bakeLighting);
            if (bakeLighting)
            {
                aoLightAmbient = EditorGUILayout.ColorField("Light Ambient", aoLightAmbient);
            }
            aoBakeMode = (AOBakeMode)EditorGUILayout.EnumPopup("Mode", aoBakeMode);

            EditorGUILayout.Space();
            if (GUILayout.Button("Bake"))
            {
                DoBakeAO(jobs, window);
            }
        }