Search Unity

SpriteAtlas new CRUD API problem.

Discussion in '2D' started by Baraphor, Aug 3, 2018.

  1. Baraphor

    Baraphor

    Joined:
    Nov 16, 2016
    Posts:
    32
    Hello,

    We have encountered a problem with the new CRUD API for SpriteAtlases, the following code will not work at all, it never saves, unless I am missing a step. However it is hard to tell because the Scripting API Docs do not even include this information yet it seems.

    Code (CSharp):
    1.  
    2. TextureImporterPlatformSettings iOS = atlas.GetPlatformSettings(BuildTarget.iOS.ToString());
    3. iOS.overridden = true;
    4. iOS.format = TextureImporterFormat.ETC2_RGBA8;
    5. atlas.SetPlatformSettings(iOS);
    6.  
     
  2. RINNUXEI

    RINNUXEI

    Joined:
    Sep 3, 2015
    Posts:
    32
    You should use "iPhone" instead of "iOS" when get and set platform settings. Although "iPhone" is marked as deprecated and my IDE suggests me to use "iOS", which just doesn't even work.
     
    joe_nk likes this.