Fix : 에디터 UI 동적 리빌드 시 PropertyField 바인딩 누락 수정 및 삭제 확인 팝업 제거

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
user 2026-02-24 00:05:06 +09:00
parent 802bea169d
commit e9739076b0
4 changed files with 32 additions and 51 deletions

View File

@ -91,6 +91,8 @@ public class AvatarOutfitControllerEditor : Editor
{ {
avatarsContainer.Add(CreateAvatarElement(i)); avatarsContainer.Add(CreateAvatarElement(i));
} }
avatarsContainer.Bind(serializedObject);
} }
private VisualElement CreateAvatarElement(int avatarIndex) private VisualElement CreateAvatarElement(int avatarIndex)
@ -264,16 +266,11 @@ public class AvatarOutfitControllerEditor : Editor
private void DeleteAvatar(int index) private void DeleteAvatar(int index)
{ {
var avatar = controller.avatars[index]; Undo.RecordObject(target, "Delete Avatar");
if (EditorUtility.DisplayDialog("아바타 삭제", controller.avatars.RemoveAt(index);
$"아바타 '{avatar.avatarName}'을(를) 삭제하시겠습니까?", "삭제", "취소")) EditorUtility.SetDirty(target);
{ serializedObject.Update();
Undo.RecordObject(target, "Delete Avatar"); RebuildAvatarList();
controller.avatars.RemoveAt(index);
EditorUtility.SetDirty(target);
serializedObject.Update();
RebuildAvatarList();
}
} }
private void SwapAvatars(int a, int b) private void SwapAvatars(int a, int b)
@ -301,18 +298,13 @@ public class AvatarOutfitControllerEditor : Editor
private void DeleteOutfit(int avatarIndex, int outfitIndex) private void DeleteOutfit(int avatarIndex, int outfitIndex)
{ {
var outfit = controller.avatars[avatarIndex].outfits[outfitIndex]; Undo.RecordObject(target, "Delete Outfit");
if (EditorUtility.DisplayDialog("의상 삭제", var outfits = new List<AvatarOutfitController.OutfitData>(controller.avatars[avatarIndex].outfits);
$"의상 '{outfit.outfitName}'을(를) 삭제하시겠습니까?", "삭제", "취소")) outfits.RemoveAt(outfitIndex);
{ controller.avatars[avatarIndex].outfits = outfits.ToArray();
Undo.RecordObject(target, "Delete Outfit"); EditorUtility.SetDirty(target);
var outfits = new List<AvatarOutfitController.OutfitData>(controller.avatars[avatarIndex].outfits); serializedObject.Update();
outfits.RemoveAt(outfitIndex); RebuildAvatarList();
controller.avatars[avatarIndex].outfits = outfits.ToArray();
EditorUtility.SetDirty(target);
serializedObject.Update();
RebuildAvatarList();
}
} }
#endregion #endregion

View File

@ -319,15 +319,10 @@ public class CameraManagerEditor : Editor
private void DeletePreset(int index) private void DeletePreset(int index)
{ {
var preset = manager.cameraPresets[index]; Undo.RecordObject(target, "Delete Camera Preset");
if (EditorUtility.DisplayDialog("프리셋 삭제", manager.cameraPresets.RemoveAt(index);
$"프리셋 '{preset.presetName}'을(를) 삭제하시겠습니까?", "삭제", "취소")) EditorUtility.SetDirty(target);
{ RebuildPresetList();
Undo.RecordObject(target, "Delete Camera Preset");
manager.cameraPresets.RemoveAt(index);
EditorUtility.SetDirty(target);
RebuildPresetList();
}
} }
private void SwapPresets(int a, int b) private void SwapPresets(int a, int b)

View File

@ -85,6 +85,8 @@ public class EventControllerEditor : Editor
{ {
eventsContainer.Add(CreateEventGroupElement(i)); eventsContainer.Add(CreateEventGroupElement(i));
} }
eventsContainer.Bind(serializedObject);
} }
private VisualElement CreateEventGroupElement(int index) private VisualElement CreateEventGroupElement(int index)
@ -156,16 +158,11 @@ public class EventControllerEditor : Editor
private void DeleteEvent(int index) private void DeleteEvent(int index)
{ {
var group = controller.eventGroups[index]; Undo.RecordObject(target, "Delete Event Group");
if (EditorUtility.DisplayDialog("이벤트 삭제", controller.eventGroups.RemoveAt(index);
$"이벤트 '{group.groupName}'을(를) 삭제하시겠습니까?", "삭제", "취소")) EditorUtility.SetDirty(target);
{ serializedObject.Update();
Undo.RecordObject(target, "Delete Event Group"); RebuildEventList();
controller.eventGroups.RemoveAt(index);
EditorUtility.SetDirty(target);
serializedObject.Update();
RebuildEventList();
}
} }
private void SwapEvents(int a, int b) private void SwapEvents(int a, int b)

View File

@ -87,6 +87,8 @@ public class ItemControllerEditor : Editor
{ {
itemsContainer.Add(CreateItemGroupElement(i)); itemsContainer.Add(CreateItemGroupElement(i));
} }
itemsContainer.Bind(serializedObject);
} }
private VisualElement CreateItemGroupElement(int index) private VisualElement CreateItemGroupElement(int index)
@ -167,16 +169,11 @@ public class ItemControllerEditor : Editor
private void DeleteItem(int index) private void DeleteItem(int index)
{ {
var group = controller.itemGroups[index]; Undo.RecordObject(target, "Delete Item Group");
if (EditorUtility.DisplayDialog("그룹 삭제", controller.itemGroups.RemoveAt(index);
$"그룹 '{group.groupName}'을(를) 삭제하시겠습니까?", "삭제", "취소")) EditorUtility.SetDirty(target);
{ serializedObject.Update();
Undo.RecordObject(target, "Delete Item Group"); RebuildItemList();
controller.itemGroups.RemoveAt(index);
EditorUtility.SetDirty(target);
serializedObject.Update();
RebuildItemList();
}
} }
private void SwapItems(int a, int b) private void SwapItems(int a, int b)