Search Unity

Bug Sprite Atlas Include In Build Bug

Discussion in '2D' started by MousePods, Jan 28, 2023.

  1. MousePods

    MousePods

    Joined:
    Jul 19, 2012
    Posts:
    811
    Hi,

    It seems the SpriteAtlasExtensions doesn't work to change the Include In Build bool.

    @Venkify You mentioned you could do this pre-build step here: https://forum.unity.com/threads/mak...tings-platform-specific.1267862/#post-8056679

    Am I doing something wrong or is it bugged?

    I am using 2022.1.0b13

    Code (CSharp):
    1. SpriteAtlas spriteAtlas = (SpriteAtlas)AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(i), typeof(SpriteAtlas));
    2. SpriteAtlasExtensions.SetIncludeInBuild(spriteAtlas, false);
    EDIT:

    Follow these threads causes the sprite atlas to not be build with the game no matter if bindAsDefault is checked yes or no. I had to delete the game and redownload via plasticSCM to get the atlases to be included with the build again. Is there a way to properly load the sprite atlas in OnPreprocessBuild?

    https://forum.unity.com/threads/mod...ields-via-editor-scripts.513239/#post-5348406
    https://forum.unity.com/threads/sol...es-dependent-on-platform.508110/#post-3377027

    Thanks
     
    Last edited: Jan 28, 2023