static bool createAttachmentBTN(Color color, GameObject prefab, GUIContent content) { if (prefab != null) { using (new GUIBackgroundColorScope(color)) { GameObject newAttachment = CustomEditorGUI.Undo_TileDeco_Instantiate_DoAll(prefab, content, true); if (newAttachment != null) { var _tile = newAttachment.GetComponentInParent <IsoTile>(); _tile.SyncIsoLight(newAttachment); } return(true); } } return(false); }
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); }