Advertisement
Avatarchik

Untitled

Jun 7th, 2022
993
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. Texture2DArray GenerateTextureArray(Texture2D[] textures)
  2.     {
  3.         Texture2DArray textureArray = new Texture2DArray(
  4.             // width, height, depth, format, mipmap
  5.             textureSize, textureSize, textures.Length, textureFormat, true
  6.         );
  7.  
  8.         for(int i = 0; i < textures.Length; i++) {
  9.             textureArray.SetPixels(textures[i].GetPixels(), i);
  10.         }
  11.         textureArray.Apply();
  12.         return textureArray;
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement