SendMessage() public method

public SendMessage ( NetMessage msg ) : void
msg NetMessage
return void
Exemplo n.º 1
0
    private void OnRestartClick()
    {
        AdminMessage msg = new AdminMessage();

        msg.Type         = DataType.AdminEvent;
        msg.Data.Control = ControlState.Reboot;
        NetManager.SendMessage(Util.ObjectToJson(msg));
    }
Exemplo n.º 2
0
    private void OnPoweOffClick()
    {
        AdminMessage msg = new AdminMessage();

        msg.Type         = DataType.AdminEvent;
        msg.Data.Control = ControlState.TurnOff;
        NetManager.SendMessage(Util.ObjectToJson(msg));
    }
Exemplo n.º 3
0
    void OnClickBack()
    {
        AdminMessage msg = new AdminMessage();

        msg.Type         = DataType.AdminEvent;
        msg.Data.Control = ControlState.Stop;
        NetManager.SendMessage(Util.ObjectToJson(msg));
        mediaPlayer.Stop();
        videoPLayerRoot.gameObject.SetActive(false);
        PanManager.AllOpenWithout(PanelName.VideoPlayPanel);
        PanManager.ClosePanel(PanelName.VideoPlayPanel);
    }
Exemplo n.º 4
0
    // 暂停
    private void OnPauseButton()
    {
        if (mediaPlayer)
        {
            mediaPlayer.Pause();
        }
        playBtn.gameObject.SetActive(true);
        pauseBtn.gameObject.SetActive(false);
        AdminMessage msg = new AdminMessage();

        msg.Type         = DataType.AdminEvent;
        msg.Data.Control = ControlState.Pause;
        NetManager.SendMessage(Util.ObjectToJson(msg));
    }
Exemplo n.º 5
0
    // 拖动进度
    private void OnVideoSeekSliderOnVideoSeekSlider(float point)
    {
        if (IsVoluntary)
        {
            IsVoluntary = false;
            return;
        }

        mediaPlayer.Position = videoSeekSlider.value;
        AdminMessage msg = new AdminMessage();

        msg.Type          = DataType.AdminEvent;
        msg.Data.Control  = ControlState.Play;
        msg.Data.Progress = mediaPlayer.Time;
        NetManager.SendMessage(Util.ObjectToJson(msg));
    }
Exemplo n.º 6
0
 void OnRestartButton(bool isOn)
 {
     if (isOn)
     {
         isLoop           = true;
         mediaPlayer.Loop = true;
         AdminMessage msg = new AdminMessage();
         msg.Type         = DataType.AdminEvent;
         msg.Data.Control = ControlState.Loop;
         NetManager.SendMessage(Util.ObjectToJson(msg));
     }
     else
     {
         isLoop           = false;
         mediaPlayer.Loop = false;
         AdminMessage msg = new AdminMessage();
         msg.Type         = DataType.AdminEvent;
         msg.Data.Control = ControlState.NoLoop;
         NetManager.SendMessage(Util.ObjectToJson(msg));
     }
 }
Exemplo n.º 7
0
    private void PlayAllNet()
    {
        if (currentChooseVideoUrl == null)
        {
            PanManager.ShowToast("您还没选择视频");
            return;
        }
        AdminMessage msg = new AdminMessage();

        msg.Type                      = DataType.AdminEvent;
        msg.Data.Control              = ControlState.Play;
        msg.Data.Progress             = 0;
        msg.Data.Resource.Id          = currentChooseVideoId;
        msg.Data.Resource.Uri         = currentChooseVideoUrl;
        msg.Data.Resource.FileType.Id = currentChooseFileType;
        msg.Data.Resource.Md5         = currentChooseMd5;
        NetManager.SendMessage(Util.ObjectToJson(msg));
        PanManager.OpenPanel <VideoPlayPanel>(PanelName.VideoPlayPanel, currentChooseVideoUrl);
        currentChooseItem.isOn = false;
        currentChooseVideoUrl  = null;

        PanManager.AllHidenWithout(PanelName.VideoPlayPanel);
    }
 public void SendMessageToClients(NetMessage msg)
 {
     net.SendMessage(msg);
 }