샘플 코드 개선. UTKHelpBox 개선

This commit is contained in:
logonkhi
2026-01-26 20:00:21 +09:00
parent 99f9c3b26d
commit 097436a8b0
18 changed files with 1321 additions and 81 deletions

View File

@@ -261,6 +261,41 @@ public async UniTask SaveDataAsync()
{
UTKTooltipManager.Instance.AttachTooltip(btnLong, "This is a longer tooltip message that demonstrates how the tooltip handles multiple lines of text content.");
}
SetCodeSamples(root,
csharpCode: @"// 1. 초기화 (앱 시작 시 한 번)
UTKTooltipManager.Instance.Initialize(rootVisualElement);
// 2. 버튼에 툴팁 연결
var saveButton = new UTKButton("""", UTKMaterialIcons.Save);
UTKTooltipManager.Instance.AttachTooltip(saveButton, ""저장 (Ctrl+S)"");
// 3. 다국어 키로 툴팁 연결
UTKTooltipManager.Instance.AttachTooltip(settingsButton, ""tooltip_settings"");
// 4. 아이콘 버튼에 툴팁
var deleteBtn = new UTKButton("""", UTKMaterialIcons.Delete) { IconOnly = true };
UTKTooltipManager.Instance.AttachTooltip(deleteBtn, ""삭제"");
// 5. 툴팁 업데이트
UTKTooltipManager.Instance.UpdateTooltip(button, ""새로운 설명"");
// 6. 툴팁 제거
UTKTooltipManager.Instance.DetachTooltip(button);
// 7. 즉시 표시 (특정 위치에)
UTKTooltipManager.Instance.Show(""임시 정보"", new Vector2(100, 200));
// 8. 숨기기
UTKTooltipManager.Instance.Hide();
// 9. 여러 요소에 툴팁 연결
var buttons = new[] { btn1, btn2, btn3 };
var tooltips = new[] { ""버튼 1"", ""버튼 2"", ""버튼 3"" };
for (int i = 0; i < buttons.Length; i++)
{
UTKTooltipManager.Instance.AttachTooltip(buttons[i], tooltips[i]);
}");
}
#endregion