static void CreateAsset() { MeshInputFilter item = EditorUtil.CreateAsset <MeshInputFilter>(NMBEditorUtil.AssetLabel); EditorUtility.FocusProjectWindow(); Selection.activeObject = item; }
/// <summary> /// Controls behavior of the inspector. /// </summary> public override void OnInspectorGUI() { MeshInputFilter targ = (MeshInputFilter)target; EditorGUILayout.Separator(); // Clamp before sending to property. targ.Priority = EditorGUILayout.IntField("Priority", targ.Priority); targ.matchType = (MatchType) EditorGUILayout.EnumPopup("Match Type", targ.matchType); EditorGUILayout.Separator(); EditorUtil.OnGUIManageObjectList("Meshes", targ.meshes, false); EditorGUILayout.Separator(); string msg = "Input Build Processor\n\nFilters out " + typeof(MeshFilter).Name + " components that reference the specified " + typeof(Mesh).Name + " objects.\n\n"; switch (targ.matchType) { case MatchType.Strict: msg += "Will match only on strict mesh equality."; break; case MatchType.NameBeginsWith: msg += "Will match any mesh that starts with the mesh names. Example: If the" + " source mesh name is 'Column', then 'ColumnWooden' and 'Column Iron' will" + " match."; break; case MatchType.AnyInstance: msg += "Will match any instance, based on name. The check is lazy. Example:" + " If the source mesh name is 'SwampMesh', then both 'SwampMesh Instance' and " + " 'SwampMesh NotReallyAnInstance' will match."; break; } GUILayout.Box(msg, EditorUtil.HelpStyle, GUILayout.ExpandWidth(true)); EditorGUILayout.Separator(); if (GUI.changed) { EditorUtility.SetDirty(target); } }