UnityEngine.Texture3D.Apply C# (CSharp) 메소드

Apply() 개인적인 메소드

private Apply ( ) : void
리턴 void
        public void Apply()
        {
            bool makeNoLongerReadable = false;
            bool updateMipmaps = true;
            this.Apply(updateMipmaps, makeNoLongerReadable);
        }

Same methods

Texture3D::Apply ( [ updateMipmaps, [ makeNoLongerReadable ) : void
Texture3D::Apply ( bool updateMipmaps ) : void

Usage Example

예제 #1
1
        /// <summary>
        /// Creates a 3D texture.
        /// </summary>
        public static Texture3D CreateTexture3DFromResources(string texturePathFromResources, int slices)
        {
            Texture3D texture3D = null;

              Texture2D texture2D = Resources.Load<Texture2D>(texturePathFromResources);
              if (texture2D != null)
              {
            int height = texture2D.height;
            int width = texture2D.width / slices;

            Color[] pixels2D = texture2D.GetPixels();
            Color[] pixels3D = new Color[pixels2D.Length];

            for (int z = 0; z < slices; ++z)
              for (int y = 0; y < height; ++y)
            for (int x = 0; x < width; ++x)
              pixels3D[x + (y * width) + (z * (width * height))] = pixels2D[x + (z * width) + (((width - y) - 1) * width * height)];

            texture3D = new Texture3D(width, height, slices, TextureFormat.ARGB32, false);
            texture3D.SetPixels(pixels3D);
            texture3D.Apply();
            texture3D.filterMode = FilterMode.Trilinear;
            texture3D.wrapMode = TextureWrapMode.Clamp;
            texture3D.anisoLevel = 1;
              }
              else
            Debug.LogWarning(string.Format("Texture '{0}' not found in 'Resources/Textures' folder.", texturePathFromResources));

              return texture3D;
        }
All Usage Examples Of UnityEngine.Texture3D::Apply