public void S2C_OnGetMainPlayerInfo(Pt _info) { isLogin = true; //Debug.logger.Log("S2C_OnGetMainPlayerInfo"); pt_usr_info_b102 pt = _info as pt_usr_info_b102; GameCenter.mainPlayerMng = MainPlayerMng.CreateNew(new MainPlayerInfo(pt)); GameCenter.mainPlayerMng.C2S_LoginInGame(); GameCenter.mainPlayerMng.ApplySubData(); if (MainPlayerMng.OnCreateNew != null) { MainPlayerMng.OnCreateNew(); } if (GameCenter.instance.isPlatform) { MainPlayerInfo mainPlayerInfo = GameCenter.mainPlayerMng.MainPlayerInfo; //这里必须加角色创建时间(中间件要求) By邓成 string playerName = mainPlayerInfo.Name + "|" + GetPlayerLastLoginTime(mainPlayerInfo.ServerInstanceID); LynSdkManager.Instance.UsrEnterGame(LoginServerID, LoginServerName, (ulong)mainPlayerInfo.ServerInstanceID, playerName, mainPlayerInfo.CurLevel, mainPlayerInfo.Prof.ToString(), mainPlayerInfo.GuildID.ToString(), mainPlayerInfo.VipLevel.ToString(), mainPlayerInfo.FightValue.ToString(), PlatformID); YvVoiceSdk.YvVoiceLogin(mainPlayerInfo.Name, mainPlayerInfo.ServerInstanceID);//云娃语音登录 //if (GameCenter.instance.isDataEyePattern) //{ // DCAccount.setLevel(GameCenter.mainPlayerMng.MainPlayerInfo.CurLevel); // DCAccount.login(Login_ID.ToString(), LoginServerName); //} } }
protected void EnterAwakeState(fsm.State _from, fsm.State _to, fsm.Event _event) { GameCenter.instance.IsReConnecteding = false; GameCenter.uIMng.ReleaseGUI(GUIType.MERRYGOROUND); GameCenter.uIMng.ReleaseGUI(GUIType.LOADING); GameCenter.uIMng.ReleaseGUI(GUIType.MAINFIGHT); GameCenter.uIMng.ReleaseGUI(GUIType.LITTLEMAP); GameCenter.uIMng.ReleaseGUI(GUIType.TASK); GameCenter.uIMng.ReleaseGUI(GUIType.GUILDACTIVITYCOPPY); GameCenter.uIMng.ReleaseGUI(GUIType.TASK_FINDING); if (GameCenter.curMainPlayer != null) { Destroy(GameCenter.curMainPlayer.gameObject); } if (GameCenter.curMainEntourage != null) { Destroy(GameCenter.curMainEntourage.gameObject); } //GameCenter.uIMng.GenGUI(GUIType.LOGIN,true); GameCenter.cameraMng.BlackCoverAll(false); SceneManager.LoadScene("LoginStage"); YvVoiceSdk.YvVoiceLogOut(); CurLoginState = EventType.AWAKE; NetMsgMng.ConectClose(); }
public void VoiceRecordMainWnd(bool _isPress, ChatInfo.Type _type, string name = null) { //Debug.Log("VoiceRecordMainWnd : " + _isPress); if (_isPress) { SetIsRcordingVoice(true); YvVoiceSdk.YvVoiceRecordVoice(); recordTime = Time.time; } else { SetIsRcordingVoice(false); float overTime = Time.time - recordTime; if (OnShowSendVoiceUpdate != null) { OnShowSendVoiceUpdate(true); } YvVoiceSdk.YvVoiceStopRecordVoice((data1, data2) => { string st = "[Voice]=[Voice]=" + data1 + "=[Voice]=" + data2 + "=[Voice]=" + (overTime); if (!string.IsNullOrEmpty(name)) { GameCenter.chatMng.SendChatContent(st, (int)_type, name); } else { GameCenter.chatMng.SendChatContent(st, (int)_type); } if (OnShowSendVoiceUpdate != null) { OnShowSendVoiceUpdate(false); } }); } }
void OnPause(GameObject go) { GameCenter.chatMng.IsPausePlayVoice = !GameCenter.chatMng.IsPausePlayVoice; playX.gameObject.SetActive(GameCenter.chatMng.IsPausePlayVoice); if (GameCenter.chatMng.IsPausePlayVoice) { YvVoiceSdk.YvVoiceStopPlayVoice(); anim.Pause(); } else { anim.Play(); } }
/// <summary> /// 自动播放语音 /// </summary> protected void SlefPlayVoice() { //NGUIDebug.Log("自动播放语音 IsAutoPlayVoice : " + IsAutoPlayVoice + " , InterruptVoiceSelfPlaying:" + InterruptVoiceSelfPlaying + " , IsPausePlayVoice : " + IsPausePlayVoice); //if (IsAutoPlayVoice && !InterruptVoiceSelfPlaying && !IsPausePlayVoice) if (!InterruptVoiceSelfPlaying && !IsPausePlayVoice) { if (voiceList.Count > 0) { string urlPath = voiceList[0].voicePath; string time = voiceList[0].accurateTime; curVoiceInfo = voiceList[0]; curVoiceInfo.AutoPlayVoice = true; YvVoiceSdk.YvVoicePlayVoiceCallBack(urlPath, time, () => { AutoPlayNextVoice(); }); } else { IsAutoPlayingVoice = false; } } }
/// <summary> /// 播放语音 /// </summary> /// <param name="_go"></param> void PlayVoice(GameObject _go) { //重新播放已经播放了的或点击自己的声音 if (!curInfo.voiceRed || curInfo.senderID == GameCenter.mainPlayerMng.MainPlayerInfo.ServerInstanceID) { PlayAni(); curInfo.voiceRed = false; if (voiceRedObj != null) { voiceRedObj.SetActive(curInfo.voiceRed); } GameCenter.chatMng.InterruptVoiceSelfPlaying = true; //Debug.Log("播放语音成功"); if (curInfo.voicePath != string.Empty) { YvVoiceSdk.YvVoicePlayVoiceCallBack(curInfo.voicePath, curInfo.accurateTime, () => { StopAni(); }); } } else//点击没有播放的开启自动播放 { if (GameCenter.chatMng.InterruptVoiceSelfPlaying) { PlayAni(); curInfo.voiceRed = false; if (voiceRedObj != null) { voiceRedObj.SetActive(curInfo.voiceRed); } if (curInfo.voicePath != string.Empty) { YvVoiceSdk.YvVoicePlayVoiceCallBack(curInfo.voicePath, curInfo.accurateTime, () => { StopAni(); }); } } else { if (GameCenter.chatMng.CurAutoPlayType == CurAutoPlayVoiceType.MAINCHAT) { GameCenter.chatMng.SetCurAutoPlayType(curInfo);//主界面自动播放切换为当前聊天界面自动播放 } else { PlayAni(); curInfo.voiceRed = false; if (voiceRedObj != null) { voiceRedObj.SetActive(curInfo.voiceRed); } GameCenter.chatMng.InterruptVoiceSelfPlaying = true; if (curInfo.voicePath != string.Empty) { YvVoiceSdk.YvVoicePlayVoiceCallBack(curInfo.voicePath, curInfo.accurateTime, () => { StopAni(); }); } } } } }