public static void DrawGUIAttachDetach(SkinAttachment attachment, HashSet <SkinAttachmentTarget> attachmentTargetSet) { EditorGUILayout.BeginVertical(); DrawGUIAttach(attachment, attachmentTargetSet); DrawGUIDetach(attachment, attachmentTargetSet); EditorGUILayout.EndVertical(); }
public void RemoveSubject(SkinAttachment subject) { if (subjects.Contains(subject)) { subjects.Remove(subject); } }
public void AddSubject(SkinAttachment subject) { if (subjects.Contains(subject) == false) { subjects.Add(subject); } }
public static void DrawGUIAttach(SkinAttachment attachment, HashSet <SkinAttachmentTarget> attachmentTargetSet) { EditorGUI.BeginDisabledGroup(attachment.attached); { if (GUILayout.Button("Attach")) { attachment.Attach(storePositionRotation: true); attachmentTargetSet.Add(attachment.targetActive); EditorUtility.SetDirty(attachment); } } EditorGUI.EndDisabledGroup(); }
public static void DrawGUIDetach(SkinAttachment attachment, HashSet <SkinAttachmentTarget> attachmentTargetSet) { EditorGUI.BeginDisabledGroup(!attachment.attached); { EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Detach")) { attachmentTargetSet.Add(attachment.targetActive); attachment.Detach(revertPositionRotation: true); EditorUtility.SetDirty(attachment); } if (GUILayout.Button("+ Hold", GUILayout.ExpandWidth(false))) { attachmentTargetSet.Add(attachment.targetActive); attachment.Detach(revertPositionRotation: false); EditorUtility.SetDirty(attachment); } EditorGUILayout.EndHorizontal(); } EditorGUI.EndDisabledGroup(); }