Exemplo n.º 1
0
 public void SetTriangles(int[] triangles, int submesh, [DefaultValue("true")] bool calculateBounds, [DefaultValue("0")] int baseVertex)
 {
     if (CheckCanAccessSubmeshTriangles(submesh))
     {
         SetTrianglesImpl(submesh, triangles, NoAllocHelpers.SafeLength(triangles), calculateBounds, baseVertex);
     }
 }
Exemplo n.º 2
0
 public void SetIndices(int[] indices, MeshTopology topology, int submesh, [DefaultValue("true")] bool calculateBounds, [DefaultValue("0")] int baseVertex)
 {
     if (CheckCanAccessSubmeshIndices(submesh))
     {
         SetIndicesImpl(submesh, topology, indices, NoAllocHelpers.SafeLength(indices), calculateBounds, baseVertex);
     }
 }
Exemplo n.º 3
0
 public void SetData <T>(List <T> data)
 {
     if (data == null)
     {
         throw new ArgumentNullException("data");
     }
     this.InternalSetData(NoAllocHelpers.ExtractArrayFromList(data), 0, 0, NoAllocHelpers.SafeLength <T>(data), Marshal.SizeOf(typeof(T)));
 }
Exemplo n.º 4
0
 public void SetIndices(ushort[] indices, int indicesStart, int indicesLength, MeshTopology topology, int submesh, bool calculateBounds = true, int baseVertex = 0)
 {
     if (CheckCanAccessSubmeshIndices(submesh))
     {
         CheckIndicesArrayRange(indices, NoAllocHelpers.SafeLength(indices), indicesStart, indicesLength);
         SetIndicesImpl(submesh, topology, UnityEngine.Rendering.IndexFormat.UInt16, indices, indicesStart, indicesLength, calculateBounds, baseVertex);
     }
 }
Exemplo n.º 5
0
 public void SetIndices(List <int> indices, int indicesStart, int indicesLength, MeshTopology topology, int submesh, bool calculateBounds = true, int baseVertex = 0)
 {
     if (CheckCanAccessSubmeshIndices(submesh))
     {
         var indicesArray = NoAllocHelpers.ExtractArrayFromList(indices);
         CheckIndicesArrayRange(indicesArray, NoAllocHelpers.SafeLength(indices), indicesStart, indicesLength);
         SetIndicesImpl(submesh, topology, UnityEngine.Rendering.IndexFormat.UInt32, indicesArray, indicesStart, indicesLength, calculateBounds, baseVertex);
     }
 }
        public void SetData <T>(List <T> data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            if (!UnsafeUtility.IsBlittable(typeof(T)))
            {
                throw new ArgumentException(string.Format("{0} type used in ComputeBuffer.SetData(List<>)) must be blittable", typeof(T)));
            }

            InternalSetData(NoAllocHelpers.ExtractArrayFromList(data), 0, 0, NoAllocHelpers.SafeLength(data), Marshal.SizeOf(typeof(T)));
        }
Exemplo n.º 7
0
        public void SetData <T>(List <T> data) where T : struct
        {
            bool flag = data == null;

            if (flag)
            {
                throw new ArgumentNullException("data");
            }
            bool flag2 = !UnsafeUtility.IsGenericListBlittable <T>();

            if (flag2)
            {
                throw new ArgumentException(string.Format("List<{0}> passed to GraphicsBuffer.SetData(List<>) must be blittable.\n{1}", typeof(T), UnsafeUtility.GetReasonForGenericListNonBlittable <T>()));
            }
            this.InternalSetData(NoAllocHelpers.ExtractArrayFromList(data), 0, 0, NoAllocHelpers.SafeLength <T>(data), Marshal.SizeOf(typeof(T)));
        }
Exemplo n.º 8
0
 private void SetListForChannel <T>(Mesh.InternalShaderChannel channel, List <T> values)
 {
     this.SetSizedArrayForChannel(channel, Mesh.InternalVertexChannelType.Float, Mesh.DefaultDimensionForChannel(channel), NoAllocHelpers.ExtractArrayFromList(values), NoAllocHelpers.SafeLength <T>(values));
 }
Exemplo n.º 9
0
 public void SetTriangles(List <int> triangles, int submesh, [UnityEngine.Internal.DefaultValue("true")] bool calculateBounds, [UnityEngine.Internal.DefaultValue("0")] int baseVertex)
 {
     if (this.CheckCanAccessSubmeshTriangles(submesh))
     {
         this.SetTrianglesImpl(submesh, NoAllocHelpers.ExtractArrayFromList(triangles), NoAllocHelpers.SafeLength <int>(triangles), calculateBounds, baseVertex);
     }
 }
Exemplo n.º 10
0
 private void SetArrayForChannel <T>(Mesh.InternalShaderChannel channel, T[] values)
 {
     this.SetSizedArrayForChannel(channel, Mesh.InternalVertexChannelType.Float, Mesh.DefaultDimensionForChannel(channel), values, NoAllocHelpers.SafeLength(values));
 }
Exemplo n.º 11
0
 private void SetListForChannel <T>(Mesh.InternalShaderChannel channel, Mesh.InternalVertexChannelType format, int dim, List <T> values)
 {
     this.SetSizedArrayForChannel(channel, format, dim, NoAllocHelpers.ExtractArrayFromList(values), NoAllocHelpers.SafeLength <T>(values));
 }
Exemplo n.º 12
0
 private void SetArrayForChannel <T>(VertexAttribute channel, T[] values)
 {
     SetSizedArrayForChannel(channel, InternalVertexChannelType.Float, DefaultDimensionForChannel(channel), values, NoAllocHelpers.SafeLength(values));
 }
Exemplo n.º 13
0
 public void SetUVs(int channel, Vector4[] uvs)
 {
     SetUVs(channel, uvs, 0, NoAllocHelpers.SafeLength(uvs));
 }
Exemplo n.º 14
0
 private void SetListForChannel <T>(VertexAttribute channel, List <T> values)
 {
     SetSizedArrayForChannel(channel, InternalVertexChannelType.Float, DefaultDimensionForChannel(channel), NoAllocHelpers.ExtractArrayFromList(values), NoAllocHelpers.SafeLength(values));
 }
Exemplo n.º 15
0
 public void SetTangents(Vector4[] inTangents, int start, int length)
 {
     SetSizedArrayForChannel(VertexAttribute.Tangent, InternalVertexChannelType.Float, DefaultDimensionForChannel(VertexAttribute.Tangent), inTangents, NoAllocHelpers.SafeLength(inTangents), start, length);
 }
Exemplo n.º 16
0
 public void SetIndices(int[] indices, MeshTopology topology, int submesh, [DefaultValue("true")] bool calculateBounds, [DefaultValue("0")] int baseVertex)
 {
     SetIndices(indices, 0, NoAllocHelpers.SafeLength(indices), topology, submesh, calculateBounds, baseVertex);
 }
Exemplo n.º 17
0
 public void SetColors(Color32[] inColors, int start, int length)
 {
     SetSizedArrayForChannel(VertexAttribute.Color, InternalVertexChannelType.Color, 4, inColors, NoAllocHelpers.SafeLength(inColors), start, length);
 }
Exemplo n.º 18
0
 public void SetTriangles(List <ushort> triangles, int trianglesStart, int trianglesLength, int submesh, bool calculateBounds = true, int baseVertex = 0)
 {
     if (CheckCanAccessSubmeshTriangles(submesh))
     {
         SetTrianglesImpl(submesh, UnityEngine.Rendering.IndexFormat.UInt16, NoAllocHelpers.ExtractArrayFromList(triangles), NoAllocHelpers.SafeLength(triangles), trianglesStart, trianglesLength, calculateBounds, baseVertex);
     }
 }
Exemplo n.º 19
0
 public void SetTriangles(List <ushort> triangles, int submesh, bool calculateBounds = true, int baseVertex = 0)
 {
     SetTriangles(triangles, 0, NoAllocHelpers.SafeLength(triangles), submesh, calculateBounds, 0);
 }
Exemplo n.º 20
0
 public void SetTriangles(List <int> triangles, int submesh, [DefaultValue("true")] bool calculateBounds, [DefaultValue("0")] int baseVertex)
 {
     SetTriangles(triangles, 0, NoAllocHelpers.SafeLength(triangles), submesh, calculateBounds, 0);
 }
Exemplo n.º 21
0
 public void SetColors(List <Color32> inColors)
 {
     SetColors(inColors, 0, NoAllocHelpers.SafeLength(inColors));
 }
Exemplo n.º 22
0
 public void SetTangents(Vector4[] inTangents)
 {
     SetTangents(inTangents, 0, NoAllocHelpers.SafeLength(inTangents));
 }
Exemplo n.º 23
0
 public void SetColors(Color[] inColors, int start, int length)
 {
     SetSizedArrayForChannel(VertexAttribute.Color, InternalVertexChannelType.Float, DefaultDimensionForChannel(VertexAttribute.Color), inColors, NoAllocHelpers.SafeLength(inColors), start, length);
 }
Exemplo n.º 24
0
 public void SetColors(Color32[] inColors)
 {
     SetColors(inColors, 0, NoAllocHelpers.SafeLength(inColors));
 }
Exemplo n.º 25
0
 private void SetArrayForChannel <T>(VertexAttribute channel, InternalVertexChannelType format, int dim, T[] values)
 {
     SetSizedArrayForChannel(channel, format, dim, values, NoAllocHelpers.SafeLength(values));
 }
Exemplo n.º 26
0
 private void SetArrayForChannel <T>(Mesh.InternalShaderChannel channel, Mesh.InternalVertexChannelType format, int dim, T[] values)
 {
     this.SetSizedArrayForChannel(channel, format, dim, values, NoAllocHelpers.SafeLength(values));
 }
Exemplo n.º 27
0
 private void SetListForChannel <T>(VertexAttribute channel, InternalVertexChannelType format, int dim, List <T> values)
 {
     SetSizedArrayForChannel(channel, format, dim, NoAllocHelpers.ExtractArrayFromList(values), NoAllocHelpers.SafeLength(values));
 }
Exemplo n.º 28
0
 private void SetUvsImpl(int uvIndex, int dim, System.Array uvs, int arrayStart, int arraySize)
 {
     if (uvIndex < 0 || uvIndex > 7)
     {
         throw new ArgumentOutOfRangeException(nameof(uvIndex), uvIndex, "The uv index is invalid. Must be in the range 0 to 7.");
     }
     SetSizedArrayForChannel(GetUVChannel(uvIndex), InternalVertexChannelType.Float, dim, uvs, NoAllocHelpers.SafeLength(uvs), arrayStart, arraySize);
 }
Exemplo n.º 29
0
 public void SetIndices(List <ushort> indices, MeshTopology topology, int submesh, bool calculateBounds = true, int baseVertex = 0)
 {
     SetIndices(indices, 0, NoAllocHelpers.SafeLength(indices), topology, submesh, calculateBounds, baseVertex);
 }
Exemplo n.º 30
0
 public void SetNormals(Vector3[] inNormals, int start, int length)
 {
     SetSizedArrayForChannel(VertexAttribute.Normal, InternalVertexChannelType.Float, DefaultDimensionForChannel(VertexAttribute.Normal), inNormals, NoAllocHelpers.SafeLength(inNormals), start, length);
 }