Exemplo n.º 1
0
        private void CreateDefaultVisualSettingsXMLFile(string fileName)
        {
            VisualSettings v = new VisualSettings
            {
                Default = new SpotlightData(
                    color: new RGB(80, 80, 80),
                    castShadows: true,
                    outerAngle: 8.25f,
                    innerAngle: 5f,
                    intensity: 30f,
                    range: 45f,
                    falloff: 45f,
                    volumeIntensity: 0.06f,
                    volumeSize: 0.175f,
                    coronaIntensity: 20f,
                    coronaSize: 1.5f,
                    volume: true,
                    corona: true,
                    specular: true,
                    movementSpeed: 1),
                Helicopter = new SpotlightData(
                    color: new RGB(80, 80, 80),
                    castShadows: true,
                    outerAngle: 9f,
                    innerAngle: 6f,
                    intensity: 35f,
                    range: 230f,
                    falloff: 50f,
                    volumeIntensity: 0.05f,
                    volumeSize: 0.125f,
                    coronaIntensity: 20f,
                    coronaSize: 1.5f,
                    volume: true,
                    corona: true,
                    specular: true,
                    movementSpeed: 1),
                Boat = new SpotlightData(
                    color: new RGB(80, 80, 80),
                    castShadows: true,
                    outerAngle: 8.5f,
                    innerAngle: 5.5f,
                    intensity: 30f,
                    range: 80f,
                    falloff: 45f,
                    volumeIntensity: 0.05f,
                    volumeSize: 0.125f,
                    coronaIntensity: 20f,
                    coronaSize: 1.5f,
                    volume: true,
                    corona: true,
                    specular: true,
                    movementSpeed: 1),
            };

            XmlSerializer ser = new XmlSerializer(typeof(VisualSettings));

            using (StreamWriter writer = new StreamWriter(fileName, false))
            {
                ser.Serialize(writer, v);
            }
        }