当前位置: 首页>>代码示例>>C#>>正文


C# BitPack.UnpackByte方法代码示例

本文整理汇总了C#中OpenMetaverse.BitPack.UnpackByte方法的典型用法代码示例。如果您正苦于以下问题:C# BitPack.UnpackByte方法的具体用法?C# BitPack.UnpackByte怎么用?C# BitPack.UnpackByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenMetaverse.BitPack的用法示例。


在下文中一共展示了BitPack.UnpackByte方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UnpackSystem

 void UnpackSystem(ref BitPack pack)
 {
     CRC = pack.UnpackUBits(32);
     PartFlags = pack.UnpackUBits(32);
     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();
 }
开发者ID:skidzTweak,项目名称:libopenmetaverse,代码行数:25,代码来源:ParticleSystem.cs

示例2: ParticleSystem

            /// <summary>
            /// Decodes a byte[] array into a ParticleSystem Object
            /// </summary>
            /// <param name="data">ParticleSystem object</param>
            /// <param name="pos">Start position for BitPacker</param>
            public ParticleSystem(byte[] data, int pos)
            {
                // TODO: Not sure exactly how many bytes we need here, so partial
                // (truncated) data will cause an exception to be thrown
                if (data.Length > 0)
                {
                    BitPack pack = new BitPack(data, pos);

                    CRC = pack.UnpackUBits(32);
                    PartFlags = pack.UnpackUBits(32);
                    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();

                    PartDataFlags = (ParticleDataFlags)pack.UnpackUBits(32);
                    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);
                }
                else
                {
                    CRC = PartFlags = 0;
                    Pattern = SourcePattern.None;
                    MaxAge = StartAge = InnerAngle = OuterAngle = BurstRate = BurstRadius = BurstSpeedMin =
                        BurstSpeedMax = 0.0f;
                    BurstPartCount = 0;
                    AngularVelocity = PartAcceleration = Vector3.Zero;
                    Texture = Target = UUID.Zero;
                    PartDataFlags = ParticleDataFlags.None;
                    PartMaxAge = 0.0f;
                    PartStartColor = PartEndColor = Color4.Black;
                    PartStartScaleX = PartStartScaleY = PartEndScaleX = PartEndScaleY = 0.0f;
                }
            }
开发者ID:3di,项目名称:3di-viewer-rei-libs,代码行数:68,代码来源:ParticleSystem.cs

示例3: UnpackLegacyData

 void UnpackLegacyData(ref BitPack pack)
 {
     PartDataFlags = (ParticleDataFlags)pack.UnpackUBits(32);
     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);
 }
开发者ID:skidzTweak,项目名称:libopenmetaverse,代码行数:19,代码来源:ParticleSystem.cs


注:本文中的OpenMetaverse.BitPack.UnpackByte方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。