コード例 #1
0
        /// <summary>
        /// Initializes smoke plume particle systems
        /// </summary>
        /// <param name="contentPath">Content path</param>
        /// <param name="texture">Texture</param>
        /// <param name="scale">System scale</param>
        /// <returns>Returns the new generated particle system description</returns>
        public static ParticleSystemDescription InitializeSmokePlume(string contentPath, string texture, float scale = 1f)
        {
            ParticleSystemDescription settings = new ParticleSystemDescription
            {
                Name = "SmokePlume",

                ContentPath = contentPath,
                TextureName = texture,

                MaxDuration = 10,

                MinHorizontalVelocity = -1.0f,
                MaxHorizontalVelocity = +1.0f,

                MinVerticalVelocity = -1.0f,
                MaxVerticalVelocity = +1.0f,

                Gravity = Vector3.Zero,

                EndVelocity = 0.75f,

                MinRotateSpeed = 0.5f,
                MaxRotateSpeed = 1.0f,

                MinStartSize = 1f,
                MaxStartSize = 2f,

                MinEndSize = 5f,
                MaxEndSize = 20f,

                MaxDurationRandomness = 1f,

                EmitterVelocitySensitivity = 1f,

                Transparent = true,
                Additive    = false
            };

            settings.Scale(scale);

            return(settings);
        }
コード例 #2
0
        /// <summary>
        /// Initializes dust particle systems
        /// </summary>
        /// <param name="contentPath">Content path</param>
        /// <param name="texture">Texture</param>
        /// <param name="scale">System scale</param>
        /// <returns>Returns the new generated particle system description</returns>
        public static ParticleSystemDescription InitializeDust(string contentPath, string texture, float scale = 1f)
        {
            ParticleSystemDescription settings = new ParticleSystemDescription
            {
                Name = "Dust",

                ContentPath = contentPath,
                TextureName = texture,

                MaxDuration = 1,

                MinHorizontalVelocity = 0,
                MaxHorizontalVelocity = 0.5f,

                MinVerticalVelocity = -1,
                MaxVerticalVelocity = 1,

                Gravity = new Vector3(0.0f, -0.35f, 0.0f),

                EndVelocity = 0.1f,

                MinColor = Color.SandyBrown * 0.5f,
                MaxColor = Color.SandyBrown,

                MinRotateSpeed = -1,
                MaxRotateSpeed = 1,

                MinStartSize = 0.25f,
                MaxStartSize = 0.5f,

                MinEndSize = 0.5f,
                MaxEndSize = 1f,

                Transparent = true,
                Additive    = false
            };

            settings.Scale(scale);

            return(settings);
        }
コード例 #3
0
        /// <summary>
        /// Initializes explosion with smoke particle systems
        /// </summary>
        /// <param name="contentPath">Content path</param>
        /// <param name="texture">Texture</param>
        /// <param name="scale">System scale</param>
        /// <returns>Returns the new generated particle system description</returns>
        public static ParticleSystemDescription InitializeSmokeExplosion(string contentPath, string texture, float scale = 1f)
        {
            ParticleSystemDescription settings = new ParticleSystemDescription
            {
                Name = "SmokeExplosion",

                ContentPath = contentPath,
                TextureName = texture,

                MaxDuration = 4,

                MinHorizontalVelocity = 0,
                MaxHorizontalVelocity = 5,

                MinVerticalVelocity = -1,
                MaxVerticalVelocity = 5,

                Gravity = new Vector3(0, -20, 0),

                EndVelocity = 0,

                MinColor = Color.LightGray,
                MaxColor = Color.White,

                MinRotateSpeed = -2,
                MaxRotateSpeed = 2,

                MinStartSize = 1,
                MaxStartSize = 1,

                MinEndSize = 10,
                MaxEndSize = 20,

                Transparent = true,
                Additive    = false
            };

            settings.Scale(scale);

            return(settings);
        }
コード例 #4
0
        /// <summary>
        /// Initializes explosion particle systems
        /// </summary>
        /// <param name="contentPath">Content path</param>
        /// <param name="texture">Texture</param>
        /// <param name="scale">System scale</param>
        /// <returns>Returns the new generated particle system description</returns>
        public static ParticleSystemDescription InitializeExplosion(string contentPath, string texture, float scale = 1f)
        {
            ParticleSystemDescription settings = new ParticleSystemDescription
            {
                Name = "Explosion",

                ContentPath = contentPath,
                TextureName = texture,

                MaxDuration           = 1.5f,
                MaxDurationRandomness = 1,

                MinHorizontalVelocity = 1.0f,
                MaxHorizontalVelocity = 1.5f,

                MinVerticalVelocity = -1f,
                MaxVerticalVelocity = 1f,

                EndVelocity = 0,

                MinColor = Color.DarkGray,
                MaxColor = Color.Gray,

                MinRotateSpeed = -1,
                MaxRotateSpeed = 1,

                MinStartSize = 0.25f,
                MaxStartSize = 0.25f,

                MinEndSize = 5,
                MaxEndSize = 10,

                Transparent = true,
                Additive    = true
            };

            settings.Scale(scale);

            return(settings);
        }
コード例 #5
0
        /// <summary>
        /// Initializes porjectile trail particle systems
        /// </summary>
        /// <param name="contentPath">Content path</param>
        /// <param name="texture">Texture</param>
        /// <param name="scale">System scale</param>
        /// <returns>Returns the new generated particle system description</returns>
        public static ParticleSystemDescription InitializeProjectileTrail(string contentPath, string texture, float scale = 1f)
        {
            ParticleSystemDescription settings = new ParticleSystemDescription
            {
                Name = "ProjectileTrail",

                ContentPath = contentPath,
                TextureName = texture,

                MaxDuration           = 0.5f,
                MaxDurationRandomness = 1.5f,

                EmitterVelocitySensitivity = 0.1f,

                MinHorizontalVelocity = -0.1f,
                MaxHorizontalVelocity = 0.1f,

                MinVerticalVelocity = -0.1f,
                MaxVerticalVelocity = 0.1f,

                MinColor = Color.Gray,
                MaxColor = Color.White,

                MinRotateSpeed = 1,
                MaxRotateSpeed = 1,

                MinStartSize = 0.25f,
                MaxStartSize = 0.5f,

                MinEndSize = 0.5f,
                MaxEndSize = 1.0f,

                Transparent = true,
                Additive    = false
            };

            settings.Scale(scale);

            return(settings);
        }
コード例 #6
0
        /// <summary>
        /// Initializes fire particle systems
        /// </summary>
        /// <param name="contentPath">Content path</param>
        /// <param name="texture">Texture</param>
        /// <param name="scale">System scale</param>
        /// <returns>Returns the new generated particle system description</returns>
        public static ParticleSystemDescription InitializeFire(string contentPath, string texture, float scale = 1f)
        {
            ParticleSystemDescription settings = new ParticleSystemDescription
            {
                Name = "Fire",

                ContentPath = contentPath,
                TextureName = texture,

                MaxDuration           = 2,
                MaxDurationRandomness = 1,

                MinHorizontalVelocity = -1f,
                MaxHorizontalVelocity = +1f,

                MinVerticalVelocity = -1f,
                MaxVerticalVelocity = 1f,

                Gravity = new Vector3(0, 0, 0),

                MinColor = new Color(1f, 1f, 1f, 0.85f),
                MaxColor = new Color(1f, 1f, 1f, 1f),

                MinStartSize = 0.1f,
                MaxStartSize = 0.5f,

                MinEndSize = 2.5f,
                MaxEndSize = 5f,

                EmitterVelocitySensitivity = 1f,

                Transparent = true,
                Additive    = true
            };

            settings.Scale(scale);

            return(settings);
        }