Esempio n. 1
0
        private void OnSelectChessSeat()
        {
            if (m_currSelectedChessSeat == null)
            {
                return;
            }

            if (Input.GetMouseButtonDown(0))
            {
                GFLog.Debug("Drop");
                ChessSeat currChessSeat = m_currSelectedChessSeat.GetComponent <ChessSeat>();
                currChessSeat.BeginDropEffect();
            }
        }
Esempio n. 2
0
        private void OnPointAtChessSeat()
        {
            GameObject pointedSeat = UMAP.I.InputManager.CurrentPointedGameObject;

            if (pointedSeat == null || pointedSeat.tag == null || !pointedSeat.CompareTag("ChessSeat"))
            {
                if (m_lastSelectedChessSeat != null)
                {
                    ChessSeat lastChessSeat = m_lastSelectedChessSeat.GetComponent <ChessSeat>();
                    lastChessSeat.ClearPreview();
                    m_lastSelectedChessSeat = null;
                    //return;
                }
                return;
            }

            m_currSelectedChessSeat = pointedSeat;
            UMAP.I.InputManager.ClearCurrentSelectedObject();
            ChessSeat currChessSeat = m_currSelectedChessSeat.GetComponent <ChessSeat>();

            if (currChessSeat == null)
            {
                return;
            }

            if (m_lastSelectedChessSeat == m_currSelectedChessSeat)
            {
                //ChessSeat.SwitchChessPieceStatue();
                return;
            }

            if (m_lastSelectedChessSeat != null)
            {
                ChessSeat lastChessSeat = m_lastSelectedChessSeat.GetComponent <ChessSeat>();
                lastChessSeat.ClearPreview();
                m_lastSelectedChessSeat = null;
                //return;
            }

            m_lastSelectedChessSeat = m_currSelectedChessSeat;
            currChessSeat.PreviewEffect(m_currSelectedChessPiese);
        }