void Inspector_Attached() { bool bUpdate = false; EditorGUI.indentLevel++; if (bShowCreateAttachmentBtn = EditorGUILayout.Foldout(bShowCreateAttachmentBtn, "Create Attachment! (each button has a tooltip)")) { CustomEditorGUI.DrawSeperator(); EditorGUILayout.LabelField("In Auto ISO, SortingOrder = Tile SO + Overlay Child Index"); bUpdate |= createAttachmentBTN(CustomEditorGUI.Color_Overlay, IsoMap.Prefab_Overlay, new GUIContent("Overlay", "This is for tile decoration, \nthere is no collider.")); CustomEditorGUI.DrawSeperator(); EditorGUILayout.LabelField("In Auto ISO, SortingOrder = Position-based calculation of RC"); using (new EditorGUILayout.HorizontalScope()) { bUpdate |= createAttachmentBTN(CustomEditorGUI.Color_Trigger, IsoMap.Prefab_TriggerPlane, new GUIContent("Trigger-IsoPlane", "This is throughtable object on the tile, \nhas trigger collider.")); bUpdate |= createAttachmentBTN(CustomEditorGUI.Color_Trigger, IsoMap.Prefab_TriggerCube, new GUIContent("Trigger-Cube", "This is throughtable object on the tile, \nhas trigger collider.")); bUpdate |= createAttachmentBTN(CustomEditorGUI.Color_Obstacle, IsoMap.Prefab_Obstacle, new GUIContent("Obstacle", "This is an obstacle on the tile, \nthere is a physical collider.")); } CustomEditorGUI.DrawSeperator(); if (bUpdate) { childInfoUpdate(); } } EditorGUI.indentLevel--; CustomEditorGUI.AttachmentHierarchyField(serializedObject, "_attachedList"); }
void Inspector_Attached() { using (new EditorGUILayout.HorizontalScope()) { bool bUpdate = false; using (new GUIBackgroundColorScope(Util.CustomEditorGUI.Color_Overlay)) { bUpdate = CustomEditorGUI.Undo_TileDeco_Instantiate_DoAll(IsoMap.instance.OverlayPrefab, "Create Overlay", true); } using (new GUIBackgroundColorScope(Util.CustomEditorGUI.Color_Obstacle)) { bUpdate = CustomEditorGUI.Undo_TileDeco_Instantiate_DoAll(IsoMap.instance.ObstaclePrefab, "Create Obstacle", true); } if (bUpdate) { childInfoUpdate(); } } CustomEditorGUI.AttachmentHierarchyField(serializedObject); }