public void SendCommandToSetUnitPosition(Unit unit, MultiTile targetPosition) { int endPosX = targetPosition.bottomLeftCorner.position.x; int endPosZ = targetPosition.bottomLeftCorner.position.z; if (Global.instance.matchType == MatchTypes.Online) { photonView.RPC("RPCSetUnitPosition", RpcTarget.All, unit.index, endPosX, endPosZ); } else { DragableUnit.SetNewPosition(unit.index, endPosX, endPosZ); } }
void RPCSetUnitPosition(int index, int endPosX, int endPosZ) { DragableUnit.SetNewPosition(index, endPosX, endPosZ); }
void RPCSetUnitPosition(int startPosX, int startPosZ, int endPosX, int endPosZ) { DragableUnit.SetNewPosition(startPosX, startPosZ, endPosX, endPosZ); }