public void Clear() { for (int i = 0; i < 10; i++) { vector3List.Add(Vector3.zero); } vector3List.Clear(); Assert.AreEqual(vector3List.Count, 0); }
public static Vector3List ConvertVector3DList(string vec) { Vector3List list = new Vector3List(); try { string strPos = vec; string[] resut = strPos.Split(s_ListSplitString, StringSplitOptions.RemoveEmptyEntries); if (resut != null && resut.Length > 0 && resut[0] != "") { for (int index = 0; index < resut.Length;) { list.Add(new ScriptRuntime.Vector3(Convert.ToSingle(resut[index]), Convert.ToSingle(resut[index + 1]), Convert.ToSingle(resut[index + 2]))); index += 3; } } } catch (System.Exception ex) { list.Clear(); LogSystem.Error("ConvertVector3DList {0} Exception:{1}/{2}", vec, ex.Message, ex.StackTrace); throw; } return(list); }
/// <summary> /// /// </summary> /// <param name="list"></param> /// <param name="items"></param> public static void Initialise(this Vector3List list, IEnumerable <float3> items) { list.Clear(); list.AddRange(items); }