Exemple #1
0
        internal override void ParseXml(XmlReader xmlNode)
        {
            Utilities.Instance.get_float4(ins.Vector, xmlNode.GetAttribute("vector"));
            var mapping_type = xmlNode.GetAttribute("mapping_type");

            if (!string.IsNullOrEmpty(mapping_type))
            {
                try
                {
                    var mt = (MappingType)Enum.Parse(typeof(MappingType), mapping_type, true);
                    Mapping = mt;
                }
                catch (ArgumentException)
                {
                    Mapping = MappingType.Texture;
                }
            }
            var f4 = new float4(0.0f);

            Utilities.Instance.get_float4(f4, xmlNode.GetAttribute("rotation"));
            Rotation = f4;
            Utilities.Instance.get_float4(f4, xmlNode.GetAttribute("translation"));
            Translation = f4;
            Utilities.Instance.get_float4(f4, xmlNode.GetAttribute("scale"));
            Scale = f4;
            bool b = false;

            Utilities.Instance.get_bool(ref b, xmlNode.GetAttribute("useminmax"));
            Utilities.Instance.get_float4(f4, xmlNode.GetAttribute("min"));
            if (b && !f4.IsZero(false))
            {
                Min = f4;
            }
            Utilities.Instance.get_float4(f4, xmlNode.GetAttribute("max"));
            if (b && !f4.IsZero(false))
            {
                Max = f4;
            }
        }
Exemple #2
0
 internal override void ParseXml(XmlReader xmlNode)
 {
     Utilities.Instance.get_float4(ins.Vector, xmlNode.GetAttribute("vector"));
     var mapping_type = xmlNode.GetAttribute("mapping_type");
     if (!string.IsNullOrEmpty(mapping_type))
     {
         try
         {
             var mt = (MappingType)Enum.Parse(typeof(MappingType), mapping_type, true);
             Mapping = mt;
         }
         catch (ArgumentException)
         {
             Mapping = MappingType.Texture;
         }
     }
     var f4 = new float4(0.0f);
     Utilities.Instance.get_float4(f4, xmlNode.GetAttribute("rotation"));
     Rotation = f4;
     Utilities.Instance.get_float4(f4, xmlNode.GetAttribute("translation"));
     Translation = f4;
     Utilities.Instance.get_float4(f4, xmlNode.GetAttribute("scale"));
     Scale = f4;
     bool b = false;
     Utilities.Instance.get_bool(ref b, xmlNode.GetAttribute("useminmax"));
     Utilities.Instance.get_float4(f4, xmlNode.GetAttribute("min"));
     if (b && !f4.IsZero(false))
     {
         Min = f4;
     }
     Utilities.Instance.get_float4(f4, xmlNode.GetAttribute("max"));
     if (b && !f4.IsZero(false))
     {
         Max = f4;
     }
 }