Beispiel #1
0
        void OnTriggerExit(Collider other)
        {
            m_hasQiZi        = false;
            m_qiZiGameObject = null;

            if (m_dragQiZi != null)
            {
                //m_dragQiZi.m_IndexTriger = null;
                m_dragQiZi = null;
            }
        }
Beispiel #2
0
        // 注册玩家下完一步棋事件的回调处理
        void PlayerChessOnceMove( )
        {
            Action <StackPlayChess> playerOnceMoveFinish = (stackPlayChess) => {
                m_playerModel.ChessMove(stackPlayChess);
            };

            foreach (BoxCollider qiziBox in m_playerRootViewPresenter.HashPlayerQiZis.Values)
            {
                GameObject qizi = qiziBox.gameObject;
                PlayerDragViewPresenter playerDragViewPresenter = qizi.GetComponent <PlayerDragViewPresenter>( );
                playerDragViewPresenter.ChessMoveFinishEvent += playerOnceMoveFinish;
            }
        }
Beispiel #3
0
        void OnTriggerEnter(Collider other)
        {
            if (other.CompareTag(TAG_PLAYER))
            {
                m_hasQiZi        = true;
                m_qiZiGameObject = other.gameObject;
                //Debuger.Log("棋子" + other.name + "落在坐标检测球" + this.name + "上!");

                if (null != other.GetComponent <PlayerDragViewPresenter>( ))
                {
                    m_dragQiZi = other.GetComponent <PlayerDragViewPresenter>( );
                    m_dragQiZi.m_IndexTriger = this;
                    Debuger.Log(string.Format("m_dragQiZi棋子GameObject={0}", other.name));
                }
                else
                {
                    Debuger.LogError(string.Format("{0}棋子GameObject上没有DragQiZi脚本", other.name));
                }
            }
        }
        void OnTriggerEnter(Collider other)
        {
            if (other.CompareTag(TAG_PLAYER)) {
                m_hasQiZi = true;
                m_qiZiGameObject = other.gameObject;
                //Debuger.Log("棋子" + other.name + "落在坐标检测球" + this.name + "上!");

                if (null != other.GetComponent<PlayerDragViewPresenter>( )) {
                    m_dragQiZi = other.GetComponent<PlayerDragViewPresenter>( );
                    m_dragQiZi.m_IndexTriger = this;
                    Debuger.Log(string.Format("m_dragQiZi棋子GameObject={0}", other.name));
                } else {
                    Debuger.LogError(string.Format("{0}棋子GameObject上没有DragQiZi脚本", other.name));
                }
            }
        }
        void OnTriggerExit(Collider other)
        {
            m_hasQiZi = false;
            m_qiZiGameObject = null;

            if (m_dragQiZi != null) {
                //m_dragQiZi.m_IndexTriger = null;
                m_dragQiZi = null;
            }
        }