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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Get architecture for active target platform

Discussion in 'Editor & General Support' started by LaPeste, Feb 22, 2023.

  1. LaPeste

    LaPeste

    Joined:
    Feb 7, 2015
    Posts:
    3
    I'm interested in obtaining the selected architecture for the active target platform. Unfortunately, looking at the documentation, all I have is an integer which supposedly maps to the various architectures.

    About that integer the documentation says:

    > An integer value associated with the architecture of the build target. 0 - None, 1 - ARM64, 2 - Universal.

    It definitely seems off.
    Is there a way I can get deeper information on what target architecture was selected?
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,735
    What are you hoping to do with this information? Perhaps the API exposes a better property/field/method for accessing what you need?
     
  3. LaPeste

    LaPeste

    Joined:
    Feb 7, 2015
    Posts:
    3
    > Perhaps the API exposes a better property/field/method for accessing what you need?

    Anything specific in mind?
    In the PlayerSettings the only fields having "Architecture" in it are `GetArchitecture` and `SetArchitecture`. If you have more information, could you share it, please?
     
  4. SF_FrankvHoof

    SF_FrankvHoof

    Joined:
    Apr 1, 2022
    Posts:
    780
    There's SystemInfo: Unity - Scripting API: SystemInfo (unity3d.com)
    And there's Application: Unity - Scripting API: Application (unity3d.com)
    Both hold a bunch of data related to the OS, Hardware, etc.
    Of course that's for Runtime. Not for Building.
     
  5. LaPeste

    LaPeste

    Joined:
    Feb 7, 2015
    Posts:
    3
    I was interested in that information at build time. So it sounds like I'm out of luck.
     
  6. SF_FrankvHoof

    SF_FrankvHoof

    Joined:
    Apr 1, 2022
    Posts:
    780