Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Which GameViewSizeGroupType is for QNX?

Discussion in 'HMI & Embedded Systems' started by TCYeh, Mar 29, 2023.

  1. TCYeh

    TCYeh

    Joined:
    Jul 25, 2022
    Posts:
    55
    Hello everyone,

    I am attempting to modify game view sizes through scripting on my editor running on QNX. However, I am having trouble finding the correct GameViewSizeGroupType for QNX.

    I have tried using standalone, but it did not work. Can anyone recommend a GameViewSizeGroupType that works for QNX? I would greatly appreciate any assistance or advice.

    Thank you in advance!
     
  2. RomanoMcBride

    RomanoMcBride

    Unity Technologies

    Joined:
    Dec 9, 2020
    Posts:
    28
    Hi! Could you elaborate what you mean by "Editor running on QNX"?

    The Editor itself is currently only supported on macOS, Windows and RedHat/Debian Linux.

    If you're talking about the QNX runtime (as in: your Unity application runs on a target that runs QNX), could you post a line of code of what you're calling here while passing a GameViewSizeGroupType?
     
  3. TCYeh

    TCYeh

    Joined:
    Jul 25, 2022
    Posts:
    55
    @RomanoMcBride Yes, my build target is set as QNX.
    Here's a code snippet that I'm using to add custom screen sizes to the GameView:
    Code (CSharp):
    1.  
    2. static void AddCustomSize(GameViewSizeType viewSizeType, GameViewSizeGroupType sizeGroupType, int resolutionX, int resolutionY, string label)
    3. {
    4.     var group = GetGroup(sizeGroupType);
    5.     var addCustomSize = group.ReturnType.GetMethod("AddCustomSize");
    6.     var gameViewSizeType = typeof(Editor).Assembly.GetType("UnityEditor.GameViewSize");
    7.     var ctor = gameViewSizeType.GetConstructor(new Type[] { gameViewSizeType, typeof(int), typeof(int), typeof(string) });
    8.     var newSize = ctor.Invoke(new object[] { viewSizeType, resolutionX, resolutionY, label });
    9.     addCustomSize.Invoke(group, new object[] { newSize });
    10. }
    11.  
    Basically, I would like to manage my screen sizes programmatically, so I need to pass GameVizeSizeGroupType to specify the group I would like to modify.

    Thank you for your help:)
     
  4. RomanoMcBride

    RomanoMcBride

    Unity Technologies

    Joined:
    Dec 9, 2020
    Posts:
    28
    Hi, I see.

    The GameViewSizeGroupType for QNX is Standalone

    I just programmatically created a new view size using GameViewSizeGroupType.Standalone while the build target was set to QNX and that works for me (2021.3.19)
     
  5. TCYeh

    TCYeh

    Joined:
    Jul 25, 2022
    Posts:
    55
    Ok, I'll give it a try again then. Thanks a lot for your response!