// Gateboxボタン押下時のイベントハンドラ private async Task OnGateboxButtonPushed() { // 2秒以内のダブルタップの場合は無視(ちょっと適当。なぜか実機で2回イベントが発生するため) var now = Time.time; if (now - lastGBPushed < 2.0f) { Debug.Log("ダブルタップのため無視します: " + (now - lastGBPushed).ToString()); return; } lastGBPushed = now; // 対話 try { var customerId = GateboxDevices.GetCustomerID() ?? "User1234567890"; await chatdoll.StartChatAsync(customerId); } catch (Exception ex) { Debug.LogError($"Error occured in chat: {ex.Message}\n{ex.StackTrace}"); } }
protected override string GetUserId() { var gateboxCustomerId = GateboxDevices.GetCustomerID(); return(!string.IsNullOrEmpty(gateboxCustomerId) ? gateboxCustomerId : base.GetUserId()); }