public override void OnInspectorGUI() { base.OnInspectorGUI(); serializedObject.Update(); GUILayout.BeginVertical("Box"); GUI.skin.label.alignment = TextAnchor.MiddleCenter; GUILayout.Label("Generator"); lineGen.IntervalBetPoints = EditorGUILayout.Toggle("Calcul two point:", lineGen.IntervalBetPoints); //Type intervals lineGen.Interval = EditorGUILayout.FloatField("Interval:", lineGen.Interval); //generation interval lineGen.typePosAndRot = (TypePosAndRot)EditorGUILayout.EnumPopup("Type Pos and Rot:", lineGen.typePosAndRot); //position and rotation of the object lineGen.typeOrder = (TypeOrder)EditorGUILayout.EnumPopup("Order:", lineGen.typeOrder); //type of generation order EditorGUI.indentLevel++; showConstraints = EditorGUILayout.Foldout(showConstraints, "Constraints"); EditorGUI.indentLevel--; if (showConstraints) { GUIFreezeRotAndPos(); } listGUI.DoLayoutList(); //List object serializedObject.ApplyModifiedProperties(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Generator")) //Button generation { Undo.RecordObject(lineGen, "Generator"); lineGen.Generator(); } if (GUILayout.Button("AllDelete")) //Button destroy all object { Undo.RecordObject(lineGen, "Delete"); lineGen.AllDelete(); } GUILayout.EndHorizontal(); GUILayout.EndVertical(); }
public void HidePathOfEnemyGroup() { //dis.text="lsdkfjlkxcvlksdlkfj"; lineGenerator.AllDelete();//把生成的物体全部删除 }