Ejemplo n.º 1
0
        public CustomDataModule(bool _)
        {
            VectorComponentCount0 = 4;
            Color0         = new MinMaxGradient(true);
            ColorLabel0    = "Color";
            Vector0_0      = new MinMaxCurve(0.0f);
            VectorLabel0_0 = "X";
            Vector0_1      = new MinMaxCurve(0.0f);
            VectorLabel0_1 = "Y";
            Vector0_2      = new MinMaxCurve(0.0f);
            VectorLabel0_2 = "Z";
            Vector0_3      = new MinMaxCurve(0.0f);
            VectorLabel0_3 = "W";

            VectorComponentCount0 = 4;
            Color1         = new MinMaxGradient(true);
            ColorLabel1    = "Color";
            Vector1_0      = new MinMaxCurve(0.0f);
            VectorLabel1_0 = "X";
            Vector1_1      = new MinMaxCurve(0.0f);
            VectorLabel1_1 = "Y";
            Vector1_2      = new MinMaxCurve(0.0f);
            VectorLabel1_2 = "Z";
            Vector1_3      = new MinMaxCurve(0.0f);
            VectorLabel1_3 = "W";
        }
Ejemplo n.º 2
0
 public MultiModeParameter(float value)
 {
     Value  = value;
     Mode   = ParticleSystemShapeMultiModeValue.Random;
     Spread = 0.0f;
     Speed  = new MinMaxCurve(1.0f);
 }
 public ParticleSystemEmissionBurst(float time, int minValue, int maxValue)
 {
     Time           = time;
     CycleCount     = 1;
     RepeatInterval = 0.01f;
     CountCurve     = new MinMaxCurve(minValue, maxValue);
 }
Ejemplo n.º 4
0
 public LightsModule(bool _)
 {
     RandomDistribution = true;
     Color          = true;
     Range          = true;
     Intensity      = true;
     RangeCurve     = new MinMaxCurve(1.0f);
     IntensityCurve = new MinMaxCurve(1.0f);
     MaxLights      = 20;
 }
Ejemplo n.º 5
0
 public TrailModule(bool _)
 {
     Ratio                = 1.0f;
     Lifetime             = new MinMaxCurve(1.0f, 1.0f, 1.0f, 1.0f);
     MinVertexDistance    = 0.2f;
     RibbonCount          = 1;
     DieWithParticles     = true;
     SizeAffectsWidth     = true;
     InheritParticleColor = true;
     ColorOverLifetime    = new MinMaxGradient(true);
     WidthOverTrail       = new MinMaxCurve(1.0f, 1.0f, 1.0f, 1.0f);
     ColorOverTrail       = new MinMaxGradient(true);
 }
Ejemplo n.º 6
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            StartLifetime.Read(reader);
            StartSpeed.Read(reader);
            StartColor.Read(reader);
            StartSize.Read(reader);
            if (IsReadSizeAxes(reader.Version))
            {
                StartSizeY.Read(reader);
                StartSizeZ.Read(reader);
            }
            if (IsReadRotationAxes(reader.Version))
            {
                StartRotationX.Read(reader);
                StartRotationY.Read(reader);
            }
            StartRotation.Read(reader);

            if (IsReadRandomizeRotationDirection(reader.Version))
            {
                RandomizeRotationDirection = reader.ReadSingle();
            }
            if (IsReadGravityModifierSingle(reader.Version))
            {
                float gravityModifier = reader.ReadSingle();
                GravityModifier = new MinMaxCurve(gravityModifier);
            }
            if (IsReadInheritVelocity(reader.Version))
            {
                InheritVelocity = reader.ReadSingle();
            }
            MaxNumParticles = reader.ReadInt32();
            if (IsReadSize3D(reader.Version))
            {
                Size3D = reader.ReadBoolean();
            }
            if (IsReadRotation3D(reader.Version))
            {
                Rotation3D = reader.ReadBoolean();
                reader.AlignStream(AlignType.Align4);
            }

            if (!IsReadGravityModifierSingle(reader.Version))
            {
                GravityModifier.Read(reader);
            }
        }
 public void Read(AssetReader reader)
 {
     Time = reader.ReadSingle();
     if (IsReadCurve(reader.Version))
     {
         CountCurve.Read(reader);
     }
     else
     {
         int minValue = reader.ReadInt32();
         int maxValue = reader.ReadInt32();
         CountCurve = new MinMaxCurve(minValue, maxValue);
     }
     CycleCount     = reader.ReadInt32();
     RepeatInterval = reader.ReadSingle();
 }
        public YAMLNode ExportYAML(IAssetsExporter exporter)
        {
#warning TODO: values acording to read version (current 2017.3.0f3)
            YAMLMappingNode node = new YAMLMappingNode();
            node.AddSerializedVersion(GetSerializedVersion(exporter.Version));
            node.Add("time", Time);
            if (IsReadCurve(exporter.Version))
            {
                node.Add("countCurve", CountCurve.ExportYAML(exporter));
            }
            else if (Config.IsExportTopmostSerializedVersion)
            {
                MinMaxCurve countCurve = new MinMaxCurve(MinValue, MaxValue);
                node.Add("countCurve", countCurve.ExportYAML(exporter));
            }
            node.Add("cycleCount", CycleCount);
            node.Add("repeatInterval", RepeatInterval);
            return(node);
        }
Ejemplo n.º 9
0
 public NoiseModule(bool _)
 {
     Strength         = new MinMaxCurve(1.0f);
     StrengthY        = new MinMaxCurve(1.0f);
     StrengthZ        = new MinMaxCurve(1.0f);
     Frequency        = 0.5f;
     Damping          = true;
     Octaves          = 1;
     OctaveMultiplier = 0.5f;
     OctaveScale      = 2.0f;
     Quality          = ParticleSystemNoiseQuality.High;
     ScrollSpeed      = new MinMaxCurve(0.0f);
     Remap            = new MinMaxCurve(1.0f, 1.0f, 1.0f, 0.0f, 1.0f);
     RemapY           = new MinMaxCurve(1.0f, 1.0f, 1.0f, 0.0f, 1.0f);
     RemapZ           = new MinMaxCurve(1.0f, 1.0f, 1.0f, 0.0f, 1.0f);
     PositionAmount   = new MinMaxCurve(1.0f);
     RotationAmount   = new MinMaxCurve(0.0f);
     SizeAmount       = new MinMaxCurve(0.0f);
 }
Ejemplo n.º 10
0
 public InheritVelocityModule(float value) :
     base(value != 0.0f)
 {
     Curve = new MinMaxCurve(value);
 }
Ejemplo n.º 11
0
 public InheritVelocityModule(bool _)
 {
     Curve = new MinMaxCurve(0.0f);
 }
Ejemplo n.º 12
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            if (IsReadType(reader.Version))
            {
                EmissionType type = (EmissionType)reader.ReadInt32();
                if (type == EmissionType.Time)
                {
                    RateOverTime.Read(reader);
                    RateOverDistance = new MinMaxCurve(0.0f);
                }
                else
                {
                    RateOverTime = new MinMaxCurve(0.0f);
                    RateOverDistance.Read(reader);
                }
            }
            else
            {
                RateOverTime.Read(reader);
                RateOverDistance.Read(reader);
            }

            if (IsReadCnt(reader.Version))
            {
                int cnt0 = IsIntCount(reader.Version) ? reader.ReadInt32() : reader.ReadUInt16();
                int cnt1 = IsIntCount(reader.Version) ? reader.ReadInt32() : reader.ReadUInt16();
                int cnt2 = IsIntCount(reader.Version) ? reader.ReadInt32() : reader.ReadUInt16();
                int cnt3 = IsIntCount(reader.Version) ? reader.ReadInt32() : reader.ReadUInt16();

                int cntMax0 = cnt0;
                int cntMax1 = cnt1;
                int cntMax2 = cnt2;
                int cntMax3 = cnt3;
                if (IsReadCntMax(reader.Version))
                {
                    cntMax0 = IsIntCount(reader.Version) ? reader.ReadInt32() : reader.ReadUInt16();
                    cntMax1 = IsIntCount(reader.Version) ? reader.ReadInt32() : reader.ReadUInt16();
                    cntMax2 = IsIntCount(reader.Version) ? reader.ReadInt32() : reader.ReadUInt16();
                    cntMax3 = IsIntCount(reader.Version) ? reader.ReadInt32() : reader.ReadUInt16();
                }

                float time0 = reader.ReadSingle();
                float time1 = reader.ReadSingle();
                float time2 = reader.ReadSingle();
                float time3 = reader.ReadSingle();

                BurstCount = IsIntCount(reader.Version) ? reader.ReadInt32() : reader.ReadByte();
                reader.AlignStream(AlignType.Align4);

                m_bursts = new ParticleSystemEmissionBurst[BurstCount];
                if (BurstCount > 0)
                {
                    m_bursts[0] = new ParticleSystemEmissionBurst(time0, cnt0, cntMax0);
                    if (BurstCount > 1)
                    {
                        m_bursts[1] = new ParticleSystemEmissionBurst(time1, cnt1, cntMax1);
                        if (BurstCount > 2)
                        {
                            m_bursts[2] = new ParticleSystemEmissionBurst(time2, cnt2, cntMax2);
                            if (BurstCount > 3)
                            {
                                m_bursts[3] = new ParticleSystemEmissionBurst(time3, cnt3, cntMax3);
                            }
                        }
                    }
                }
            }
            else
            {
                BurstCount = reader.ReadInt32();
                reader.AlignStream(AlignType.Align4);

                m_bursts = reader.ReadArray <ParticleSystemEmissionBurst>();
            }
        }
Ejemplo n.º 13
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            Type = (ParticleSystemCollisionType)reader.ReadInt32();
            if (IsReadCollisionMode(reader.Version))
            {
                CollisionMode = (ParticleSystemCollisionMode)reader.ReadInt32();
            }
            if (IsReadColliderForce(reader.Version))
            {
                ColliderForce = reader.ReadSingle();
                MultiplyColliderForceByParticleSize   = reader.ReadBoolean();
                MultiplyColliderForceByParticleSpeed  = reader.ReadBoolean();
                MultiplyColliderForceByCollisionAngle = reader.ReadBoolean();
                reader.AlignStream(AlignType.Align4);
            }

            Plane0.Read(reader);
            Plane1.Read(reader);
            Plane2.Read(reader);
            Plane3.Read(reader);
            Plane4.Read(reader);
            Plane5.Read(reader);

            if (IsReadDampenSingle(reader.Version))
            {
                float dampenSingle = reader.ReadSingle();
                float bounceSingle = reader.ReadSingle();
                float energyLossOnCollisionSingle = reader.ReadSingle();
                Dampen = new MinMaxCurve(dampenSingle);
                Bounce = new MinMaxCurve(bounceSingle);
                EnergyLossOnCollision = new MinMaxCurve(energyLossOnCollisionSingle);
            }
            else
            {
                Dampen.Read(reader);
                Bounce.Read(reader);
                EnergyLossOnCollision.Read(reader);
            }

            MinKillSpeed = reader.ReadSingle();
            if (IsReadMaxKillSpeed(reader.Version))
            {
                MaxKillSpeed = reader.ReadSingle();
            }
            if (IsReadRadiusScale(reader.Version))
            {
                RadiusScale = reader.ReadSingle();
                CollidesWith.Read(reader);
            }
            if (IsReadMaxCollisionShapes(reader.Version))
            {
                MaxCollisionShapes = reader.ReadInt32();
            }
            if (IsReadQuality(reader.Version))
            {
                Quality   = (ParticleSystemCollisionQuality)reader.ReadInt32();
                VoxelSize = reader.ReadSingle();
            }
            if (IsReadCollisionMessages(reader.Version))
            {
                CollisionMessages = reader.ReadBoolean();
            }
            if (IsReadCollidesWithDynamic(reader.Version))
            {
                CollidesWithDynamic = reader.ReadBoolean();
                InteriorCollisions  = reader.ReadBoolean();
                reader.AlignStream(AlignType.Align4);
            }
        }