コード例 #1
0
    // Start is called before the first frame update
    void Start()
    {
        var la = new ListAccessor <int>(5);

        la.Reserve(10);
        la[9] = 2;
        Debug.Assert(la[0] == default(int));
        Debug.Assert(la[8] == default(int));
        Debug.Assert(la[9] == 2);
        Debug.Log(la[10]);// 产生异常
    }
コード例 #2
0
 /// <summary>
 /// Устанавливает получатель списка элементов заданного типа.
 /// </summary>
 /// <param name="accessor">The accessor.</param>
 /// <returns>Группу настроек фильтрации данных</returns>
 public T SetListAccessor(ListAccessor accessor)
 {
     this.accessor = accessor;
     return(this as T);
 }
コード例 #3
0
        public ArrayView(List <T> list)
        {
            this.array = ListAccessor <T> .GetArray(list);

            this.size = list.Count;
        }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ListQSFilterSetting&lt;T, TElement&gt;"/> class.
 /// </summary>
 public ListQSFilterSetting()
 {
     accessor = null;
     List     = new List <TElement>();
 }
コード例 #5
0
        public void SetTriangles(int[] triangles, int count)
        {
            ListAccessor <int> .SetArray(s_ScratchInt, triangles, count);

            mesh.SetTriangles(s_ScratchInt, 0);
        }
コード例 #6
0
 public static T[] GetInternalArray <T>(List <T> list)
 {
     //returns the internal backing array
     return(ListAccessor <T> .accessor(list));
 }
コード例 #7
0
        public void SetTextureCoord3(Vector4[] texCoords, int count)
        {
            ListAccessor <Vector4> .SetArray(s_ScratchVector4, texCoords, count);

            mesh.SetUVs(3, s_ScratchVector4);
        }
コード例 #8
0
        public void SetNormals(Vector3[] normals, int count)
        {
            ListAccessor <Vector3> .SetArray(s_ScratchVector3, normals, count);

            mesh.SetNormals(s_ScratchVector3);
        }
コード例 #9
0
        public void SetColors(Color[] colors, int count)
        {
            ListAccessor <Color> .SetArray(s_ScratchColor, colors, count);

            mesh.SetColors(s_ScratchColor);
        }
コード例 #10
0
        public void SetVertices(Vector3[] positions, int count)
        {
            ListAccessor <Vector3> .SetArray(s_ScratchVector3, positions, count);

            mesh.SetVertices(s_ScratchVector3);
        }
コード例 #11
0
ファイル: ListExtension.cs プロジェクト: light8reeze/HGServer
 public static T[] GetListArray <T>(this List <T> list)
 {
     return(ListAccessor <T> .Getter(list));
 }