예제 #1
0
 public override void OnInspectorGUI()
 {
     GUIDraw.DrawSpacer();
     GUI.color = Color.red;
     EditorGUILayout.BeginVertical("Box");
     GUI.color = Color.white;
     GUIDraw.Label("Modifications to this LOD Group will apply to all children", 12);
     EditorGUILayout.EndVertical();
     GUIDraw.DrawSpacer();
 }
        void DrawInspectorGUI()
        {
            GUIDraw.DrawSpacer();
            EditorGUILayout.BeginVertical("Box");
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Version 1.0");

            GUI.backgroundColor = Color.green;
            if (GUILayout.Button("Documentation"))
            {
                Application.OpenURL("http://www.terraincomposer.com/mcs-documentation/");
            }
            GUI.backgroundColor = Color.white;
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.EndVertical();
            GUIDraw.DrawSpacer();
            DrawSearchOptions(Color.red * editorSkinMulti);
            GUIDraw.DrawSpacer();
            DrawOutputSettings(Color.blue * editorSkinMulti);
            GUIDraw.DrawSpacer();
            DrawRuntime(Color.green * editorSkinMulti);
            GUIDraw.DrawSpacer();
        }
        public override void OnInspectorGUI()
        {
            meshCombiner = (MeshCombiner)target;
            serializedObject.Update();

            DrawInspectorGUI();
            serializedObject.ApplyModifiedProperties();

            // DrawDefaultInspector();

            if (!meshCombiner.combined && (meshCombiner.transform.position != meshCombiner.oldPosition || meshCombiner.transform.lossyScale != meshCombiner.oldScale))
            {
                if (meshCombiner.octreeCreated)
                {
                    // Debug.Log("Reset");
                    meshCombiner.ResetOctree();
                }
                meshCombiner.oldPosition = meshCombiner.transform.position;
                meshCombiner.oldScale    = meshCombiner.transform.localScale;
            }

            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("Search"))
            {
                meshCombiner.AddToOctree();
                SceneView.RepaintAll();
            }

            Transform t = meshCombiner.transform;

            if (searchBoxSquare.boolValue)
            {
                Vector3 localScale = t.localScale;
                t.localScale = new Vector3(localScale.x, localScale.x, localScale.x);
            }

            if (!combineInRuntime.boolValue)
            {
                GUILayout.Space(10);
                if (GUILayout.Button("Combine"))
                {
                    meshCombiner.CombineLods();
                }
            }

            EditorGUILayout.EndHorizontal();
            if (meshCombiner.octreeCreated)
            {
                DisplayOctreeInfo();
            }

            GUIDraw.DrawSpacer();
            if (meshCombiner.combinedList.Count > 0)
            {
                if (GUILayout.Button("Delete Combined Objects"))
                {
                    meshCombiner.DestroyCombinedGameObjects();
                }
                GUIDraw.DrawSpacer();
            }
        }