/// <summary> /// 创建实例 /// </summary> public static CUnitMoveDirRequest create(int instanceID, int type, PosData pos, DirData dir, DirData realDir, int realSpeedRatio) { CUnitMoveDirRequest re = (CUnitMoveDirRequest)BytesControl.createRequest(dataID); re.instanceID = instanceID; re.type = type; re.pos = pos; re.dir = dir; re.realDir = realDir; re.realSpeedRatio = realSpeedRatio; return(re); }
private void sendMoveDir() { if (_sendLastTime == 0) { _sendLastTime = Global.clientMoveSendMinDelay; if (_realMoveSpeedRatio >= 0f) { CUnitMoveDirRequest.create(_unit.instanceID, _d.moveType, _pos, _baseMoveDir, _realMoveDir, (int)Math.Round(_realMoveSpeedRatio * 100f)).send(); } else { CUnitMoveDirRequest.create(_unit.instanceID, _d.moveType, _pos, _baseMoveDir, null, -1).send(); } } }