Ejemplo n.º 1
0
        public static void SyncMP(ProtocolBase protocol)
        {
            int           start = 0;
            ProtocolBytes proto = (ProtocolBytes)protocol;

            proto.GetNameX(start, ref start);
            long  instant = proto.GetInt(start, ref start);
            int   id      = proto.GetByte(start, ref start);
            Unit  unit    = Gamef.GetUnit(id);
            float val     = proto.GetFloat(start, ref start);

            unit.SyncUnitState.SyncMP(instant, val);
        }
Ejemplo n.º 2
0
        public static void SyncTransform(ProtocolBase protocol)
        {
            int           start = 0;
            ProtocolBytes proto = (ProtocolBytes)protocol;

            proto.GetNameX(start, ref start);
            long       instant  = proto.GetInt(start, ref start);
            int        id       = proto.GetByte(start, ref start);
            Unit       unit     = Gamef.GetUnit(id);
            Vector3    position = ParseVector3(proto, ref start);
            Quaternion rot      = ParseQuaternion(proto, ref start);
            float      speed    = proto.GetFloat(start, ref start);

            unit.SyncMovement.SyncTransform(instant, position, rot, speed);
        }