コード例 #1
0
            void UnpackSystem(ref BitPack pack)
            {
                CRC            = pack.UnpackUInt();
                PartFlags      = pack.UnpackUInt();
                Pattern        = (SourcePattern)pack.UnpackByte();
                MaxAge         = pack.UnpackFixed(false, 8, 8);
                StartAge       = pack.UnpackFixed(false, 8, 8);
                InnerAngle     = pack.UnpackFixed(false, 3, 5);
                OuterAngle     = pack.UnpackFixed(false, 3, 5);
                BurstRate      = pack.UnpackFixed(false, 8, 8);
                BurstRadius    = pack.UnpackFixed(false, 8, 8);
                BurstSpeedMin  = pack.UnpackFixed(false, 8, 8);
                BurstSpeedMax  = pack.UnpackFixed(false, 8, 8);
                BurstPartCount = pack.UnpackByte();
                float x = pack.UnpackFixed(true, 8, 7);
                float y = pack.UnpackFixed(true, 8, 7);
                float z = pack.UnpackFixed(true, 8, 7);

                AngularVelocity = new Vector3(x, y, z);
                x = pack.UnpackFixed(true, 8, 7);
                y = pack.UnpackFixed(true, 8, 7);
                z = pack.UnpackFixed(true, 8, 7);
                PartAcceleration = new Vector3(x, y, z);
                Texture          = pack.UnpackUUID();
                Target           = pack.UnpackUUID();
            }
コード例 #2
0
            void UnpackLegacyData(ref BitPack pack)
            {
                PartDataFlags = (ParticleDataFlags)pack.UnpackUInt();
                PartMaxAge    = pack.UnpackFixed(false, 8, 8);
                byte r = pack.UnpackByte();
                byte g = pack.UnpackByte();
                byte b = pack.UnpackByte();
                byte a = pack.UnpackByte();

                PartStartColor = new Color4(r, g, b, a);
                r               = pack.UnpackByte();
                g               = pack.UnpackByte();
                b               = pack.UnpackByte();
                a               = pack.UnpackByte();
                PartEndColor    = new Color4(r, g, b, a);
                PartStartScaleX = pack.UnpackFixed(false, 3, 5);
                PartStartScaleY = pack.UnpackFixed(false, 3, 5);
                PartEndScaleX   = pack.UnpackFixed(false, 3, 5);
                PartEndScaleY   = pack.UnpackFixed(false, 3, 5);
            }