Example #1
0
 public static Vector3 GetVector(RAttribute att)
 {
     string v = att.Value;
     Vector3 vector = Vector3.Zero;
     try
     {
         if (v.Contains(','))
         {
             string[] nums = v.Split(new string[] { ", ", ",", " , " }, StringSplitOptions.RemoveEmptyEntries);
             vector.X = float.Parse(nums[0]);
             vector.Y = float.Parse(nums[1]);
             vector.Z = float.Parse(nums[2]);
         }
         else
         {
             vector = new Vector3(float.Parse(v));
         }
     }
     catch (Exception)
     {
         throw new Exception("Incorrect vector format at " + att.Name + " at " + att.Parent.Name);
     }
     return vector;
 }
Example #2
0
 public void Add(string a, RAttribute att)
 {
     Attributes.Add(a, att);
 }