public void ClickButton(GameObject click) { if (click.name.Equals("AVPro Video")) { MediaPlayerMgr.Stop(); UIManager.ShowPanel(PanelType.PanelHandControl); } }
public override void OnMessage(IMessage message) { switch (message.Name) { case MessageDef.VideoPlay: //更新消息 MediaPlayerMgr.Rewind(false); MediaPlayerMgr.Play(); break; } }
public void VideoPlay(string data) { string message = data; string url = Util.VideoDicPath + data; if (!File.Exists(url)) { return; } MediaPlayerMgr.OpenVideoFromFile(MediaPlayer.FileLocation.AbsolutePathOrURL, url, true); }
public void VideoPlay(VideoNode data) { string message = data.name; string url = Util.VideoDicPath + data.name; if (!File.Exists(url)) { return; } PicturePlayer.enabled = false; MediaPlayerMgr.OpenVideoFromFile(MediaPlayer.FileLocation.AbsolutePathOrURL, url, true); MediaPlayerMgr.Play(); }
public override void OnMessage(IMessage message) { string name = message.Name; object body = message.Body; switch (name) { case MessageDef.VideoPlayBusy: //更新消息 //VideoList = (List<VideoNode>)message.Body; SetIndexNum(); break; case MessageDef.VideoPlay: //更新消息 MediaPlayerMgr.Stop(); break; } }
public void UpdateMessage(VideoNode data) { string message = data.name; string url = Application.streamingAssetsPath + "/VideoData/" + data.name; if (!File.Exists(url)) { return; } vPlayer._mediaPlayer = MediaPlayerMgr; PicturePlayer.enabled = false; MediaPlayerMgr.OpenVideoFromFile(MediaPlayer.FileLocation.AbsolutePathOrURL, url, true); MediaPlayerMgr.Events.AddListener(FinishVideo); //vPlayer.url = url; //vPlayer.prepareCompleted += Prepared; //vPlayer.Prepare(); //vPlayer.loopPointReached += EndPlayer; }
/// <summary> /// 接受游戏反馈消息,并上传id到服务器获取游戏金额 /// </summary> /// <param name="message"></param> public void UpdateResult(IMessage message) { string data = (string)message.Body; if (data == "连接到客户端") { PanelWaiting.gameObject.SetActive(false); } else { GUID = Util.GetGUID(); //生成新的GUID string result = ""; float sendPrice = 0; if (data == "成功") { sendPrice = goldPrice; result = PostGUID(appId, meachineId, GUID, goldPrice); } else if (data == "失败") { sendPrice = 0; result = PostGUID(appId, meachineId, GUID, 0f); } ServerManager.SendMessageClient("退出"); //关闭游戏 MediaPlayerMgr.SetVolume(1); if (result != string.Empty) { PostGUID post = JsonMapper.ToObject <PostGUID>(result); //生成二维码 if (post.errCode == 0) { UIManager.ShowPanel(PanelType.PanelPay, GUID, sendPrice, true); Close(); } } } }
/// <summary> /// 获取用户信息,判断游戏次数 /// </summary> /// <param name="message"></param> private void ReceiveMsg(IMessage message) { string ReceiveMsg = message.Body.ToString(); userData = SerializeHelper.DeSerializeJson <UserData>(ReceiveMsg); GameManager.m_UserData = userData; if (userData != null) { int times = int.Parse(userData.gametimes); if (times > 0) { LoginGame = true; ReSetTime(); PanelLogin.gameObject.SetActive(false); PanelWaiting.gameObject.SetActive(true); MediaPlayerMgr.SetVolume(0); facade.SendMessageCommand(MessageDef.PlayGame, PlayGameValue); } else { Warning.enabled = true; } } }