Exemple #1
0
        public void FromBytes(BinaryReader reader, IWorldAccessor resolver)
        {
            MinQuantity       = reader.ReadSingle();
            AddQuantity       = reader.ReadSingle();
            MinPos            = Vec3d.CreateFromBytes(reader);
            AddPos            = Vec3d.CreateFromBytes(reader);
            MinVelocity       = Vec3f.CreateFromBytes(reader);
            AddVelocity       = Vec3f.CreateFromBytes(reader);
            LifeLength        = reader.ReadSingle();
            GravityEffect     = reader.ReadSingle();
            MinSize           = reader.ReadSingle();
            MaxSize           = reader.ReadSingle();
            Color             = reader.ReadInt32();
            VertexFlags       = reader.ReadInt32();
            ParticleModel     = (EnumParticleModel)reader.ReadInt32();
            ShouldDieInAir    = reader.ReadBoolean();
            ShouldDieInLiquid = reader.ReadBoolean();

            if (!reader.ReadBoolean())
            {
                OpacityEvolve = EvolvingNatFloat.CreateFromBytes(reader);
            }

            if (!reader.ReadBoolean())
            {
                RedEvolve = EvolvingNatFloat.CreateFromBytes(reader);
            }

            if (!reader.ReadBoolean())
            {
                GreenEvolve = EvolvingNatFloat.CreateFromBytes(reader);
            }

            if (!reader.ReadBoolean())
            {
                BlueEvolve = EvolvingNatFloat.CreateFromBytes(reader);
            }


            if (!reader.ReadBoolean())
            {
                SizeEvolve = EvolvingNatFloat.CreateFromBytes(reader);
            }


            SelfPropelled = reader.ReadBoolean();

            if (!reader.ReadBoolean())
            {
                ColorByBlock = resolver.Blocks[reader.ReadInt32()];
            }

            if (!reader.ReadBoolean())
            {
                ClimateColorMap = reader.ReadString();
            }

            if (!reader.ReadBoolean())
            {
                SeasonColorMap = reader.ReadString();
            }
        }
Exemple #2
0
 public SimpleParticleProperties(float minQuantity, float maxQuantity, int color, Vec3d minPos, Vec3d maxPos, Vec3f minVelocity, Vec3f maxVelocity, float lifeLength = 1f, float gravityEffect = 1f, float minSize = 1f, float maxSize = 1f, EnumParticleModel model = EnumParticleModel.Cube)
 {
     this.MinQuantity   = minQuantity;
     this.AddQuantity   = maxQuantity - minQuantity;
     this.Color         = color;
     this.MinPos        = minPos;
     this.AddPos        = maxPos - minPos;
     this.MinVelocity   = minVelocity;
     this.AddVelocity   = maxVelocity - minVelocity;
     this.LifeLength    = lifeLength;
     this.GravityEffect = gravityEffect;
     this.MinSize       = minSize;
     this.MaxSize       = maxSize;
     this.ParticleModel = model;
 }