public override void Load(XmlElement xmlNode) { base.Load(xmlNode); if (xmlNode.HasAttribute("Global")) { global = bool.Parse(xmlNode.GetAttribute("Global")); } if (xmlNode.HasAttribute("CastShadows")) { castShadows = bool.Parse(xmlNode.GetAttribute("CastShadows")); } if (xmlNode.HasAttribute("AmbientLightColor")) { ambientLightColor = Vector4Helper.FromString(xmlNode.GetAttribute("AmbientLightColor")); } XmlElement lightSourceXml = (XmlElement)xmlNode.ChildNodes[0]; lightSource = (LightSource)Activator.CreateInstance( Type.GetType(lightSourceXml.Name)); lightSource.Load(lightSourceXml); }