Exemple #1
0
        public void ConfirmOccupiedCells()
        {
            List <CellObjCtrl> occupiedCtrls = GetOccupiedCellObjCtrls();

            foreach (CellObjCtrl ctrl in occupiedCtrls)
            {
                ChessDragRotator dragRotator =
                    ctrl.GetComponentInChildren <ChessDragRotator> ();
                dragRotator.enabled = false;
            }
        }
Exemple #2
0
 public void TurnDragRotaters(bool bEnable)
 {
     foreach (GameObject gb in _Cells)
     {
         if (gb != null)
         {
             ChessDragRotator dr = gb.GetComponentInChildren <ChessDragRotator> ();
             dr.enabled = bEnable;
         }
     }
 }
Exemple #3
0
        private void TurnDragRotatorForCellObjCtrl(CellObjCtrl ctrl, bool bON)
        {
            if (ctrl == null)
            {
                return;
            }
            ChessDragRotator dragRotator =
                ctrl.GetComponentInChildren <ChessDragRotator> ();

            dragRotator.enabled = bON;
        }
Exemple #4
0
        // 开关转向操作UI
        // 目前,只允许刚落入的棋子能够随意转向
        public bool IsTurnDirUION(Hex coord)
        {
            CellObjCtrl cctrl = _GridCtrl.GetCellCtrlAt(coord);

            if (cctrl == null)
            {
                return(false);
            }
            ChessDragRotator dragRoter =
                cctrl.GetComponentInChildren <ChessDragRotator> ();

            return(dragRoter.enabled);
        }
Exemple #5
0
        private bool TurnDragRotatorUI(Hex coord, bool bEnable)
        {
            CellObjCtrl cctrl = _GridCtrl.GetCellCtrlAt(coord);

            if (cctrl == null)
            {
                return(false);
            }

            ChessDragRotator dragRoter =
                cctrl.GetComponentInChildren <ChessDragRotator> ();

            dragRoter.enabled = bEnable;
            return(true);
        }
Exemple #6
0
        public bool TurnDragRotaterAt(Hex pos, bool bEnable)
        {
            bool bExist =
                _HexToCells.ContainsKey(pos);

            if (bExist)
            {
                GameObject       cellobj = GetCellObjAt(pos);
                ChessDragRotator dr      = cellobj.GetComponentInChildren <ChessDragRotator> ();
                dr.enabled = bEnable;
                return(true);
            }
            else
            {
                return(false);
            }
        }