Exemplo n.º 1
0
        public override MugicPacket GetUpdate()
        {
            if (!dirty)
            {
                return(null);
            }

            MugicPacket packet = new MugicPacket();

            base.InitPacket(MugicCommand.Rectangle, packet);

            packet.Parameter(MugicParam.X, position.X * Config.WallScalar);
            packet.Parameter(MugicParam.Y, position.Y * Config.WallScalar);
            packet.Parameter(MugicParam.Z, position.Z * Config.WallScalar);

            packet.Parameter(MugicParam.Width, bounds.width * Config.WallScalar);
            packet.Parameter(MugicParam.Height, bounds.height * Config.WallScalar);

            if (image != null)
            {
                packet.Parameter(MugicParam.Texture, image.Filename);
            }

            dirty = false;

            return(packet);
        }
Exemplo n.º 2
0
 protected void InitPacket(MugicCommand s, MugicPacket p)
 {
     if (!wasCreated)
     {
         objectId = MugicObjectManager.NextId;
         p.Command(s, objectId);
         wasCreated = true;
     }
     else
     {
         p.Command(MugicCommand.Update, objectId);
     }
 }