Search Unity

Textures Error

Discussion in 'Scripting' started by Sicerath, Mar 20, 2019.

Thread Status:
Not open for further replies.
  1. Sicerath

    Sicerath

    Joined:
    Feb 2, 2019
    Posts:
    5
    I'm using a script from Unity Store asset (Runtime Object Importer) but I'm having some trouble because I keep getting the following errors:

    Assets/TextureLoader/ImageLoader.cs(130,70): error CS0117: 'TextureFormat' does not contain a definition for 'ETC2_RGBA8Crunched'
    Assets/TextureLoader/ImageLoader.cs(126,70): error CS0117: 'TextureFormat' does not contain a definition for 'DXT5Crunched'
    Assets/TextureLoader/ImageLoader.cs(123,70): error CS0117: 'TextureFormat' does not contain a definition for 'DXT1Crunched'


    Here's the code that's causing trouble:
    Code (CSharp):
    1. var crnTextureFormat = UnityEngine.TextureFormat.RGB24;
    2.                     if (crnFormatByte == 0)
    3.                     {
    4.                         crnTextureFormat = UnityEngine.TextureFormat.DXT1Crunched;
    5.                     }else if(crnFormatByte == 2)
    6.                     {
    7.                         crnTextureFormat = UnityEngine.TextureFormat.DXT5Crunched;
    8.                     }
    9.                     else if(crnFormatByte == 12)
    10.                     {
    11.                         crnTextureFormat = UnityEngine.TextureFormat.ETC2_RGBA8Crunched;
    12.                     }
    13.                     else
    14.                     {
    15.                         Debug.LogError("Could not load crunched texture " + name + " because its format is not supported (" + crnFormatByte + "): " + fn);
    16.                         break;
    17.                     }
    Any idea what I can do?

    Note: I’m building for iOS, and I’ve seen that these texture formats don’t work on iOS. Could I replace them with something else?
     
    Last edited: Mar 21, 2019
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,448
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,448
Thread Status:
Not open for further replies.