Beispiel #1
0
    /// <summary>
    /// Yesボタンクリック時
    /// </summary>
    private void OnClickTakeOverConfirmYesButton()
    {
        if (string.IsNullOrEmpty(this.idInputField.text))
        {
            return;
        }
        if (string.IsNullOrEmpty(this.passInputField.text))
        {
            return;
        }

        // API実行
        UserApi.CallDeviceChangeCode(
            takeOverId: idInputField.text,
            takeOverPass: passInputField.text,
            onCompleted: (response) =>
        {
            UserData.Get().userId   = response.tUsersLogin.userId;
            UserData.Get().password = response.password;

            // 以前の他のIDにログインした機器の場合でも、残っているPlayerPrefsをすべて削除
            PlayerPrefs.DeleteAll();

            this.dialog.Close();
            this.onCompleted?.Invoke();
        },
            onError: (errorCode) =>
        {
            var dialog  = SharedUI.Instance.ShowSimpleDialog(true);
            var content = dialog.SetAsMessageDialog(string.Format("ERROR_CODE : {0}", errorCode));
            content.buttonGroup.buttons[0].onClick = dialog.Close;
        });
    }