예제 #1
0
        protected override void RenderTakeTurn()
        {
            base.RenderTakeTurn();

            if (_turntype == 1)
            {
                _com.HoldCard = _holdcard.Go;
                _holdcard.RenderQueBrightness();

                RenderTakeCard(() => {
                    _com.SwitchOnTouch();
                });
            }
            else if (_turntype == 0)
            {
                Vector3 dst = CalcPos(_cards.Count + 1);
                _holdcard.Go.transform.localRotation = _backv;

                //
                _com.Remove(_holdcard);
                _com.HoldCard = _holdcard.Go;

                Sequence mySequence = DOTween.Sequence();
                mySequence.Append(_holdcard.Go.transform.DOLocalMove(dst, _holdafterpengdelta))
                .AppendCallback(() => {
                    UnityEngine.Debug.Assert(_hashu == false);
                    _go.GetComponent <GL.Game.BottomPlayer>().SwitchOnTouch();
                });
            }
            else if (_turntype == 2)
            {
                if (_xuanque)
                {
                    _xuanque.GetComponent <GL.Game.UI.XuanQue>().Close();
                }

                UnityEngine.Debug.Assert(_hashu == false);
                _com.Head.ShowTips("你是庄家请先出牌");
                //_com.HoldCard = _holdcard.Go;
                _com.SwitchOnTouch();
            }
            else if (_turntype == 3)
            {
                UnityEngine.Debug.Assert(_hashu == false);
                //_com.HoldCard = _holdcard.Go;
                if (_hashu)
                {
                    Maria.Command cmd = new Maria.Command(MyEventCmd.EVENT_LEAD, _holdcard.Go);
                    _ctx.Enqueue(cmd);
                }
                else
                {
                    _com.SwitchOnTouch();
                }
            }
        }
예제 #2
0
        protected override void RenderBoxing()
        {
            try {
                int  count = 0;
                Desk desk  = ((GameController)_controller).Desk;
                desk.RenderShowRightSlot(() => {
                });

                for (int i = 0; i < _takecards.Count; i++)
                {
                    int   idx = i / 2;
                    float x   = desk.Width - (_takebottomoffset);
                    float y   = Card.HeightMZ + Card.Height / 2.0f;
                    float z   = desk.Length - (_takeleftoffset + idx * Card.Width + Card.Width / 2.0f);

                    if (i % 2 == 0)
                    {
                        y = Card.HeightMZ + Card.Height + Card.Height / 2.0f;
                    }
                    else if (i % 2 == 1)
                    {
                        y = Card.HeightMZ + Card.Height / 2.0f;
                    }

                    Card card = _takecards[i];
                    card.Go.transform.localRotation = _downv;

                    card.Go.transform.localPosition = new UnityEngine.Vector3(x, y - _takemove, z);
                    Tween t = card.Go.transform.DOLocalMoveY(y, _takemovedelta);

                    Sequence mySequence = DOTween.Sequence();
                    mySequence.Append(t)
                    .AppendCallback(() => {
                        count++;
                        if (count == _takecards.Count)
                        {
                            Maria.Command cmd = new Maria.Command(MyEventCmd.EVENT_BOXINGCARDS);
                            _ctx.Enqueue(cmd);
                        }
                    });
                }

                desk.RenderCloseRightSlot(() => {
                });
            } catch (Exception ex) {
                UnityEngine.Debug.LogException(ex);
            }
        }
예제 #3
0
        public void OnJoin()
        {
            if (_RoomNum == null)
            {
                return;
            }
            if (_sended)
            {
                return;
            }
            if (_count == _max)
            {
                Maria.Message msg = new Maria.Message();
                msg["roomid"] = _num;

                Maria.Command cmd = new Maria.Command(MyEventCmd.EVENT_MUI_JOIN, gameObject, msg);
                GetComponent <FindApp>().App.Enqueue(cmd);
                _sended = true;
            }
        }
예제 #4
0
 public void SetupStartRoot()
 {
     Maria.Command cmd = new Maria.Command(MyEventCmd.EVENT_SETUP_STARTROOT, gameObject);
     _root.App.Enqueue(cmd);
 }
예제 #5
0
        protected override void RenderCall()
        {
            if (Call.Gang == OpCodes.OPCODE_ANGANG ||
                Call.Gang == OpCodes.OPCODE_BUGANG ||
                (Call.Hu.Code != HuType.NONE && Call.Hu.Jiao == JiaoType.ZIMO) ||
                (Call.Hu.Code != HuType.NONE && Call.Hu.Jiao == JiaoType.DIANGANGHUA) ||
                (Call.Hu.Code != HuType.NONE && Call.Hu.Jiao == JiaoType.ZIGANGHUA))
            {
                Vector3 dst = CalcPos(_cards.Count + 1);
                _holdcard.Go.transform.localPosition = dst + _holdnaoffset;
                _holdcard.Go.transform.localRotation = _backv;

                _com.HoldCard = _holdcard.Go;
                _holdcard.RenderQueBrightness();

                Sequence mySequence = DOTween.Sequence();
                mySequence.Append(_holdcard.Go.transform.DOLocalMove(dst, _holddowndelta))
                .AppendCallback(() => {
                    if (_hashu)
                    {
                        if (Call.Hu.Code != HuType.NONE)
                        {
                            Maria.Command cmd = new Maria.Command(MyEventCmd.EVENT_HU);
                            _ctx.Enqueue(cmd);
                        }
                        else
                        {
                            Maria.Command cmd = new Maria.Command(MyEventCmd.EVENT_GUO);
                            _ctx.Enqueue(cmd);
                        }
                    }
                    else
                    {
                        if (Call.Peng == OpCodes.OPCODE_PENG)
                        {
                            _go.GetComponent <GL.Game.BottomPlayer>().ShowPeng();
                        }
                        if (Call.Gang == OpCodes.OPCODE_ANGANG || Call.Gang == OpCodes.OPCODE_BUGANG || Call.Gang == OpCodes.OPCODE_ZHIGANG)
                        {
                            _go.GetComponent <GL.Game.BottomPlayer>().ShowGang();
                        }
                        if (Call.Hu.Code != HuType.NONE)
                        {
                            _go.GetComponent <GL.Game.BottomPlayer>().ShowHu();
                        }
                        _go.GetComponent <GL.Game.BottomPlayer>().ShowGuo();
                    }
                });
            }
            else
            {
                if (_hashu)
                {
                    if (Call.Hu.Code != HuType.NONE)
                    {
                        Maria.Command cmd = new Maria.Command(MyEventCmd.EVENT_HU);
                        _ctx.Enqueue(cmd);
                    }
                    else
                    {
                        Maria.Command cmd = new Maria.Command(MyEventCmd.EVENT_GUO);
                        _ctx.Enqueue(cmd);
                    }
                }
                else
                {
                    if (Call.Peng == OpCodes.OPCODE_PENG)
                    {
                        _go.GetComponent <GL.Game.BottomPlayer>().ShowPeng();
                    }
                    if (Call.Gang == OpCodes.OPCODE_ANGANG || Call.Gang == OpCodes.OPCODE_BUGANG || Call.Gang == OpCodes.OPCODE_ZHIGANG)
                    {
                        _go.GetComponent <GL.Game.BottomPlayer>().ShowGang();
                    }
                    if (Call.Hu.Code != HuType.NONE)
                    {
                        _go.GetComponent <GL.Game.BottomPlayer>().ShowHu();
                    }
                    _go.GetComponent <GL.Game.BottomPlayer>().ShowGuo();
                }
            }
        }
예제 #6
0
        public void OnInvite()
        {
            Command cmd = new Maria.Command(MyEventCmd.EVENT_GAME_INVITE);

            _Root.App.Enqueue(cmd);
        }
예제 #7
0
        public void OnSetting()
        {
            Command cmd = new Maria.Command(MyEventCmd.EVENT_GAME_OPENSETTING, gameObject);

            _Root.App.Enqueue(cmd);
        }
예제 #8
0
        // Use this for initialization
        void Start()
        {
            Command cmd = new Maria.Command(MyEventCmd.EVENT_SETUP_GUIROOT, gameObject);

            _Root.App.Enqueue(cmd);
        }
예제 #9
0
 public void OnMatch()
 {
     Maria.Command cmd = new Maria.Command(MyEventCmd.EVENT_MUI_MATCH, gameObject);
     _Root.App.Enqueue(cmd);
 }
예제 #10
0
 public void SetupRoot()
 {
     Maria.Command cmd = new Maria.Command(EventCmd.EVENT_START_SETUP_ROOT, gameObject);
     Bacon.GL.Util.App.current.Enqueue(cmd);
 }