Beispiel #1
0
 protected override void RegisterUIEvent()
 {
     RegisterEvent(Event.ShowToast, (msg) => {
         EventMsgWithValue <string> event_msg = msg as EventMsgWithValue <string>;
         ShowMessage(event_msg.value);
     });
 }
Beispiel #2
0
    protected override void RegisterUIEvent()
    {
        mUIComponents.Discard_Button.onClick.AddListener(() =>
        {
            var cards = GetCards();
            //NetworkManager.Instance.Get<GameClient>().Client.BeginInvokeServiceService((int)ServerCommand.Discard, new object[] { cards });
        });

        mUIComponents.Abandon_Button.onClick.AddListener(() =>
        {
            //NetworkManager.Instance.Get<GameClient>().Client.BeginInvokeServiceService((int)ServerCommand.Pass, new object[] { });
        });

        mUIComponents.Prompt_Button.onClick.AddListener(() =>
        {
            Prompt();
        });
        mUIComponents.ResultBack_Button.onClick.AddListener(() =>
        {
            SceneManager.Instance.OpenScene(Scene.Main);
        });
        mUIComponents.Ready_Button.onClick.AddListener(() => {
            //NetworkManager.Instance.Get<GameClient>().Client.BeginInvokeServiceService((int)ServerCommand.Ready, new object[] { });
        });
        mUIComponents.Setting_Button.onClick.AddListener(() => {
            SceneManager.Instance.OpenScene(Scene.Setting);
        });
        mUIComponents.Leave_Button.onClick.AddListener(() => {
            //NetworkManager.Instance.Get<GameClient>().Client.BeginInvokeServiceService((int)ServerCommand.Leave, new object[] { });
        });
        mUIComponents.ResultShare_Button.onClick.AddListener(() => {
            byte[] imageBytes = ScreenShot.GetScreenShot(1280 * 720, 75);
            byte[] thumbBytes = ScreenShot.GetScreenShot(426 * 240, 75);

            WXSDK.ShareImage(imageBytes, thumbBytes, WXShareType.WXSceneSession);
        });

        RegisterEvent(Event.UpdateRoomInfo, (msg) =>
        {
            EventMsgWithValue <RoomInfo> event_msg = msg as EventMsgWithValue <RoomInfo>;
            UpdateRoom(event_msg.value);
        });
    }