public override void OnInspectorGUI() { myCombine = (CombineMeshes)target; DrawDefaultInspector(); if (myCombine.myMeshFilter.sharedMesh == null) { if (GUILayout.Button("Combine Meshes")) { myCombine.EnableMeshNewCollider(); } } if (myCombine.myMeshFilter.sharedMesh != null) { if (GUILayout.Button("Save As Prefab (DESTRUCTIVE)")) { SaveMeshData(true); } if (GUILayout.Button("Save As Prefab (Non-Destructive)")) { SaveMeshData(false); } if (GUILayout.Button("Disable Meshes")) { myCombine.DisableMesh(); EditorGUIUtility.ExitGUI(); } } }
public void OnEnable() { myCombine = (CombineMeshes)target; myCombine.Start(); }