Device API
Device API
진동
VibrateShort(type, onSuccess, onFail)
짧은 진동 (15ms)을 실행합니다.
파라미터:
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
type | VibrateType | - | 진동 강도 (heavy, medium, light) |
onSuccess | Action<VibrateShortResult> | - | 성공 콜백 |
onFail | Action<string> | - | 실패 콜백 |
TudadaSDK.Instance.VibrateShort(
type: VibrateType.medium, // heavy, medium, light
onSuccess: (result) => Debug.Log("진동 실행")
);
VibrateLong(onSuccess, onFail)
긴 진동 (400ms)을 실행합니다.
파라미터:
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
onSuccess | Action<VibrateLongResult> | - | 성공 콜백 |
onFail | Action<string> | - | 실패 콜백 |
TudadaSDK.Instance.VibrateLong(
onSuccess: (result) => Debug.Log("긴 진동 실행")
);
키보드
ShowKeyboard(defaultValue, maxLength, multiple, confirmHold, confirmType, onSuccess, onFail)
소프트 키보드를 표시합니다.
파라미터:
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
defaultValue | string | - | 기본 입력값 |
maxLength | int | - | 최대 입력 길이 |
multiple | bool | - | 여러 줄 입력 허용 |
confirmHold | bool | - | 확인 후 키보드 유지 |
confirmType | KeyboardConfirmType | - | 확인 버튼 타입 |
onSuccess | Action<ShowKeyboardResult> | - | 성공 콜백 |
onFail | Action<string> | - | 실패 콜백 |
KeyboardConfirmType 옵션:
| 값 | 설명 |
|---|---|
done | 완료 |
next | 다음 |
search | 검색 |
go | 이동 |
send | 전송 |
TudadaSDK.Instance.ShowKeyboard(
defaultValue: "",
maxLength: 100,
multiple: false,
confirmHold: false,
confirmType: KeyboardConfirmType.done,
onSuccess: (result) => Debug.Log("키보드 표시됨")
);
HideKeyboard()
소프트 키보드를 숨깁니다.
TudadaSDK.Instance.HideKeyboard();
OnKeyboardInput (이벤트)
키보드 입력 변경 시 호출되는 이벤트입니다.
콜백 파라미터 (KeyboardInputResult):
| 필드 | 타입 | 설명 |
|---|---|---|
value | string | 현재 입력값 |
TudadaSDK.OnKeyboardInput += (result) => {
Debug.Log("입력: " + result.value);
};
OnKeyboardConfirm (이벤트)
키보드 확인 버튼 클릭 시 호출되는 이벤트입니다.
콜백 파라미터 (KeyboardConfirmResult):
| 필드 | 타입 | 설명 |
|---|---|---|
value | string | 확인된 입력값 |
TudadaSDK.OnKeyboardConfirm += (result) => {
Debug.Log("확인: " + result.value);
};
OnKeyboardComplete (이벤트)
키보드 입력 완료 시 호출되는 이벤트입니다.
콜백 파라미터 (KeyboardCompleteResult):
| 필드 | 타입 | 설명 |
|---|---|---|
value | string | 최종 입력값 |
TudadaSDK.OnKeyboardComplete += (result) => {
Debug.Log("완료: " + result.value);
};