當前位置: 首頁>>代碼示例>>C#>>正文


C# Mesh.SetTangents方法代碼示例

本文整理匯總了C#中UnityEngine.Mesh.SetTangents方法的典型用法代碼示例。如果您正苦於以下問題:C# Mesh.SetTangents方法的具體用法?C# Mesh.SetTangents怎麽用?C# Mesh.SetTangents使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UnityEngine.Mesh的用法示例。


在下文中一共展示了Mesh.SetTangents方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: FillMesh

 /// <summary>
 /// <para>Fill the given mesh with the stream data.</para>
 /// </summary>
 /// <param name="mesh"></param>
 public void FillMesh(Mesh mesh)
 {
     mesh.Clear();
     if (this.m_Positions.Count >= 0xfde8)
     {
         throw new ArgumentException("Mesh can not have more than 65000 vertices");
     }
     mesh.SetVertices(this.m_Positions);
     mesh.SetColors(this.m_Colors);
     mesh.SetUVs(0, this.m_Uv0S);
     mesh.SetUVs(1, this.m_Uv1S);
     mesh.SetNormals(this.m_Normals);
     mesh.SetTangents(this.m_Tangents);
     mesh.SetTriangles(this.m_Indices, 0);
     mesh.RecalculateBounds();
 }
開發者ID:CarlosHBC,項目名稱:UnityDecompiled,代碼行數:20,代碼來源:VertexHelper.cs

示例2: SetVertices

 public void SetVertices(UIVertex[] vertices, int size)
 {
   Mesh mesh = new Mesh();
   List<Vector3> inVertices = new List<Vector3>();
   List<Color32> inColors = new List<Color32>();
   List<Vector2> uvs1 = new List<Vector2>();
   List<Vector2> uvs2 = new List<Vector2>();
   List<Vector3> inNormals = new List<Vector3>();
   List<Vector4> inTangents = new List<Vector4>();
   List<int> intList = new List<int>();
   int num = 0;
   while (num < size)
   {
     for (int index = 0; index < 4; ++index)
     {
       inVertices.Add(vertices[num + index].position);
       inColors.Add(vertices[num + index].color);
       uvs1.Add(vertices[num + index].uv0);
       uvs2.Add(vertices[num + index].uv1);
       inNormals.Add(vertices[num + index].normal);
       inTangents.Add(vertices[num + index].tangent);
     }
     intList.Add(num);
     intList.Add(num + 1);
     intList.Add(num + 2);
     intList.Add(num + 2);
     intList.Add(num + 3);
     intList.Add(num);
     num += 4;
   }
   mesh.SetVertices(inVertices);
   mesh.SetColors(inColors);
   mesh.SetNormals(inNormals);
   mesh.SetTangents(inTangents);
   mesh.SetUVs(0, uvs1);
   mesh.SetUVs(1, uvs2);
   mesh.SetIndices(intList.ToArray(), MeshTopology.Triangles, 0);
   this.SetMesh(mesh);
   Object.DestroyImmediate((Object) mesh);
 }
開發者ID:BlakeTriana,項目名稱:unity-decompiled,代碼行數:40,代碼來源:CanvasRenderer.cs

示例3: SetVertices

 public void SetVertices(UIVertex[] vertices, int size)
 {
     Mesh mesh = new Mesh();
     List<Vector3> inVertices = new List<Vector3>();
     List<Color32> inColors = new List<Color32>();
     List<Vector2> uvs = new List<Vector2>();
     List<Vector2> list4 = new List<Vector2>();
     List<Vector3> inNormals = new List<Vector3>();
     List<Vector4> inTangents = new List<Vector4>();
     List<int> list7 = new List<int>();
     for (int i = 0; i < size; i += 4)
     {
         for (int j = 0; j < 4; j++)
         {
             inVertices.Add(vertices[i + j].position);
             inColors.Add(vertices[i + j].color);
             uvs.Add(vertices[i + j].uv0);
             list4.Add(vertices[i + j].uv1);
             inNormals.Add(vertices[i + j].normal);
             inTangents.Add(vertices[i + j].tangent);
         }
         list7.Add(i);
         list7.Add(i + 1);
         list7.Add(i + 2);
         list7.Add(i + 2);
         list7.Add(i + 3);
         list7.Add(i);
     }
     mesh.SetVertices(inVertices);
     mesh.SetColors(inColors);
     mesh.SetNormals(inNormals);
     mesh.SetTangents(inTangents);
     mesh.SetUVs(0, uvs);
     mesh.SetUVs(1, list4);
     mesh.SetIndices(list7.ToArray(), MeshTopology.Triangles, 0);
     this.SetMesh(mesh);
     UnityEngine.Object.DestroyImmediate(mesh);
 }
開發者ID:randomize,項目名稱:VimConfig,代碼行數:38,代碼來源:CanvasRenderer.cs

示例4: FillMesh

 public void FillMesh(Mesh mesh)
 {
     mesh.Clear();
     mesh.SetVertices(this.m_Positions);
     mesh.SetColors(this.m_Colors);
     mesh.SetUVs(0, this.m_Uv0S);
     mesh.SetUVs(1, this.m_Uv1S);
     mesh.SetNormals(this.m_Normals);
     mesh.SetTangents(this.m_Tangents);
     mesh.SetTriangles(this.m_Indicies, 0);
     mesh.RecalculateBounds();
 }
開發者ID:randomize,項目名稱:VimConfig,代碼行數:12,代碼來源:VertexHelper.cs


注:本文中的UnityEngine.Mesh.SetTangents方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。