public void ConfirmOccupiedCells() { List <CellObjCtrl> occupiedCtrls = GetOccupiedCellObjCtrls(); foreach (CellObjCtrl ctrl in occupiedCtrls) { ChessDragRotator dragRotator = ctrl.GetComponentInChildren <ChessDragRotator> (); dragRotator.enabled = false; } }
public void TurnDragRotaters(bool bEnable) { foreach (GameObject gb in _Cells) { if (gb != null) { ChessDragRotator dr = gb.GetComponentInChildren <ChessDragRotator> (); dr.enabled = bEnable; } } }
private void TurnDragRotatorForCellObjCtrl(CellObjCtrl ctrl, bool bON) { if (ctrl == null) { return; } ChessDragRotator dragRotator = ctrl.GetComponentInChildren <ChessDragRotator> (); dragRotator.enabled = bON; }
// 开关转向操作UI // 目前,只允许刚落入的棋子能够随意转向 public bool IsTurnDirUION(Hex coord) { CellObjCtrl cctrl = _GridCtrl.GetCellCtrlAt(coord); if (cctrl == null) { return(false); } ChessDragRotator dragRoter = cctrl.GetComponentInChildren <ChessDragRotator> (); return(dragRoter.enabled); }
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); }
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); } }