public override void Load(XmlElement xe) { base.Load(xe); switch (this.Region) { case ERegionType.Sphere: { Scope = new ScopeSphere(); ScopeSphere v = Scope as ScopeSphere; v.Offset = EXml.ReadVector3(xe, "Offset"); v.Euler = EXml.ReadVector3(xe, "Euler"); v.Radius = EXml.ReadFloat(xe, "Radius"); } break; case ERegionType.Box: { Scope = new ScopeBox(); ScopeBox v = Scope as ScopeBox; v.Offset = EXml.ReadVector3(xe, "Offset"); v.Euler = EXml.ReadVector3(xe, "Euler"); v.H = EXml.ReadFloat(xe, "H"); v.L = EXml.ReadFloat(xe, "L"); v.W = EXml.ReadFloat(xe, "W"); } break; case ERegionType.Cylinder: { Scope = new ScopeCylinder(); ScopeCylinder v = Scope as ScopeCylinder; v.Offset = EXml.ReadVector3(xe, "Offset"); v.Euler = EXml.ReadVector3(xe, "Euler"); v.MaxDis = EXml.ReadFloat(xe, "MaxDis"); v.HAngle = EXml.ReadFloat(xe, "HAngle"); v.Height = EXml.ReadFloat(xe, "Height"); } break; } }
public override void Load(XmlElement xe) { base.Load(xe); Rate = EXml.ReadFloat(xe, "Rate"); Percent = EXml.ReadFloat(xe, "Percent"); }