Example #1
0
    public override void OnListenerMessage(EventParamete parameteData)
    {
        //接收监听事件的数据,然后用switch判断做处理

        //除此之外,也可以在这里监听UDP传输的数据,但是接收的数据是子线程数据,要通过队列接收,
        //然后在update转换成主线程数据,才能对数据进行处理

        if (parameteData.EvendName == TransportType.UdpToState.ToString())
        {
            QueueData queueData = parameteData.GetParameter <QueueData>()[0];
            GetVs.Enqueue(queueData);
        }

        if (parameteData.EvendName == TransportType.SwitchPanel.ToString())
        {
            PanelName panelName = parameteData.GetParameter <PanelName>()[0];
            switch (panelName)
            {
            case PanelName.WaitPanel:
                CurrentTask.ChangeTask(new WaitTask(this));
                break;

            case PanelName.DisplayPanel:
                CurrentTask.ChangeTask(new DisplayTask(this));
                break;

            case PanelName.SailingPanel:
                CurrentTask.ChangeTask(new SailingTask(this));
                break;

            default:
                break;
            }
        }
    }
Example #2
0
    public override void OnListenerMessage(EventParamete parameteData)
    {
        //接收监听事件的数据,然后用swich判断做处理

        //除此之外,也可以在这里监听UDP传输的数据,但是接收的数据是子线程数据,要通过队列接收,
        //然后在update转换成主线程数据,才能对数据进行处理

        //if(parameteData.EvendName == "aaa")
        //{
        //    //获取数据parameteData.GetParameter<string>()[0]
        //    GetVs.Enqueue(parameteData.GetParameter<string>()[0]);
        //}

        if (parameteData.EvendName == MTFrame.EventType.PanelSwitch.ToString())
        {
            PanelName panelName = parameteData.GetParameter <PanelName>()[0];
            switch (panelName)
            {
            case PanelName.WaitPanel:

                break;

            default:
                break;
            }
        }
    }
Example #3
0
    private void callback(EventParamete parameteData)
    {
        //如果需要判断事件名就用parameteData.EvendName
        //如果需要判断数据内容就用string data = parameteData.GetParameter<string>()[0];
        //要接收什么类型的数据就定义什么类型的数据,这里只会获取你选择的数据类型的数据
        string data = parameteData.GetParameter <string>()[0];

        text.text = data;
    }
Example #4
0
 private void callback(EventParamete parameteData)
 {
     if (parameteData.EvendName == ParmaterCodes.People.ToString())
     {
         string     data       = parameteData.GetParameter <string>()[0];
         RotateData rotateData = new RotateData();
         rotateData = Newtonsoft.Json.JsonConvert.DeserializeObject <RotateData>(data);
     }
 }
Example #5
0
    public override void OnListenerMessage(EventParamete parameteData)
    {
        string eventname = parameteData.EvendName;

        if (eventname == MTFrame.MTEvent.EventType.CollideEventName.ToString())
        {
            CollideEventName data = parameteData.GetParameter <CollideEventName>()[0];
            switch (data)
            {
            case CollideEventName.ccc:
                Debug.Log("ccc");
                break;

            case CollideEventName.ddd:
                Debug.Log("ddd");
                break;

            default:
                break;
            }
        }
        else if (eventname == MTFrame.MTEvent.EventType.RayEventName.ToString())
        {
            RayEventName data = parameteData.GetParameter <RayEventName>()[0];
            switch (data)
            {
            case RayEventName.aaa:
                Debug.Log("aaa");
                break;

            case RayEventName.bbb:
                Debug.Log("bbb");
                break;

            default:
                break;
            }
        }
    }
Example #6
0
    public override void OnListenerMessage(EventParamete parameteData)
    {
        //接收监听事件的数据,然后用swich判断做处理

        //除此之外,也可以在这里监听UDP传输的数据,但是接收的数据是子线程数据,要通过队列接收,
        //然后在update转换成主线程数据,才能对数据进行处理

        if (parameteData.EvendName == "aaa")
        {
            //获取数据parameteData.GetParameter<string>()[0]
            GetVs.Enqueue(parameteData.GetParameter <string>()[0]);
        }
    }
Example #7
0
    public override void OnListenerMessage(EventParamete parameteData)
    {
        //接收监听事件的数据,然后用swich判断做处理

        if (parameteData.EvendName == MTFrame.EventType.PanelSwitch.ToString())
        {
            PanelName panelName = parameteData.GetParameter <PanelName>()[0];
            switch (panelName)
            {
            case PanelName.WaitPanel:

                break;

            default:
                break;
            }
        }
    }
Example #8
0
    public override void OnListenerMessage(EventParamete parameteData)
    {
        if (parameteData.EvendName == SwitchPanelEvent)
        {
            switch (parameteData.GetParameter <SwitchPanelEnum>()[0])
            {
            case SwitchPanelEnum.StartMenuPanel:
                CurrentTask.ChangeTask(new StartMenutask(this));
                break;

            case SwitchPanelEnum.GamePanel:
                CurrentTask.ChangeTask(new Gametask(this));
                break;

            case SwitchPanelEnum.AppreciatePanel:
                CurrentTask.ChangeTask(new AppreciateTask(this));
                break;
            }
        }
    }
Example #9
0
    public override void OnListenerMessage(EventParamete parameteData)
    {
        if (parameteData.EvendName == SwitchPanel.PanelToState.ToString())
        {
            PanelName panelName = parameteData.GetParameter <PanelName>()[0];
            switch (panelName)
            {
            case PanelName.WaitPanel:
                CurrentTask.ChangeTask(new WaitTask(this));
                break;

            case PanelName.MenuPanel:
                CurrentTask.ChangeTask(new MenuTask(this));
                break;

            default:
                break;
            }
        }
    }
Example #10
0
    private void callback(EventParamete parameteData)
    {
        //如果需要判断事件名就用parameteData.EvendName
        //如果需要判断数据内容就用string data = parameteData.GetParameter<string>()[0];
        //要接收什么类型的数据就定义什么类型的数据,这里只会获取你选择的数据类型的数据
        string data = parameteData.GetParameter <string>()[0];

        switch (data)
        {
        case "5":
            if (IsComplete)
            {
                StartCoroutine("CountDown");
                if (videoModel == VideoModel.屏保模式)
                {
                    videoModel = VideoModel.点播模式;
                    PingBaoVideo.Stop();
                    PingBaoVideo.gameObject.GetComponent <CanvasGroup>().alpha = 0;
                }

                if (videoPlayers[5].Control.IsPlaying())
                {
                    Reset();
                    for (int i = 0; i < buttons.Length; i++)
                    {
                        Button_Open(i);
                        PingBaoStart();
                    }
                }
                else
                {
                    PlayVideo(5);
                }
            }

            break;

        case "6":
            if (IsComplete)
            {
                StartCoroutine("CountDown");
                if (videoModel == VideoModel.点播模式)
                {
                    Enter_PingBao_Model();
                    PingBaoClose();
                }
                else
                {
                    Enter_DianBo_Model();
                    PingBaoStart();
                }
            }
            break;

        default:
            break;
        }


        if (videoModel == VideoModel.点播模式)
        {
            switch (data)
            {
            case "0":
                if (!videoPlayers[0].Control.IsPlaying() && !videoPlayers[5].Control.IsPlaying())
                {
                    PlayVideo(0);
                }
                break;

            case "1":
                if (!videoPlayers[1].Control.IsPlaying() && !videoPlayers[5].Control.IsPlaying())
                {
                    PlayVideo(1);
                }
                break;

            case "2":
                if (!videoPlayers[2].Control.IsPlaying() && !videoPlayers[5].Control.IsPlaying())
                {
                    PlayVideo(2);
                }
                break;

            case "3":
                if (!videoPlayers[3].Control.IsPlaying() && !videoPlayers[5].Control.IsPlaying())
                {
                    PlayVideo(3);
                }
                break;

            case "4":
                if (!videoPlayers[4].Control.IsPlaying() && !videoPlayers[5].Control.IsPlaying())
                {
                    PlayVideo(4);
                }
                break;

            default:
                break;
            }
        }
    }
Example #11
0
    private void OnLoadProcess(EventParamete parameteData)
    {
        float f = parameteData.GetParameter <float>()[0];

        loadProcess = f;
    }