Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

What is the parameter "buildTarget" in GetPlatformSettings in SpriteAtlasExtensions

Discussion in 'Scripting' started by theforgot3n1, Jun 10, 2021.

  1. theforgot3n1

    theforgot3n1

    Joined:
    Sep 26, 2018
    Posts:
    188
    In the SpriteAtlasExtensions static method GetPlatformSettings, I don't know what the parameter buildTarget is supposed to represent. Do I just type in "Windows"? I feel like it shouldn't be this arbitrary. Does anyone know what options there are?

    Specifically, I would like to set the "Default" build target.
     
  2. theforgot3n1

    theforgot3n1

    Joined:
    Sep 26, 2018
    Posts:
    188
    This is still not clear in the docs as far as I can tell. Anybody knows?
     
  3. perholmes

    perholmes

    Joined:
    Dec 29, 2017
    Posts:
    295
    I found your question trying to use SetPlatformSettings to set Android build architectures in a scripted build system. But I think these are not necessary.

    All of the parameters are actually articulated in APIs, spread across multiple classes. I was trying to get everything through EditorUserBuildSettings, but there's also PlayerSettings, also for individual platforms, like PlayerSettings.Android. So I was able to set architectures in the pretty way:

    Code (CSharp):
    1. PlayerSettings.Android.targetArchitectures = UnityEditor.AndroidArchitecture.ARM64 | UnityEditor.AndroidArchitecture.ARMv7;
     
  4. Infinite-3D

    Infinite-3D

    Joined:
    Jan 5, 2020
    Posts:
    37
    I found the string for the default build target settings here. It's "DefaultTexturePlatform". I don't know the strings for other platforms, but this was all I needed.

    Unity really needs to put things like this in the docs.