Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Get operating system level accessibility preferences?

Discussion in 'Accessibility' started by GaeelBradshaw, May 4, 2021.

  1. GaeelBradshaw

    GaeelBradshaw

    Joined:
    Feb 26, 2021
    Posts:
    3
    Web standards use a set of CSS media queries to allow designers to adapt their designs depending on the settings of the operating system and devices: https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries

    There are notably a few that are accessibility-oriented (prefers-color-scheme, prefers-reduced-motion, prefers-contrast). This lets a user set preferences in their operating system settings, and have their preferences applied across all programs and websites that implement the standards.

    Is there a way to query these preferences from within a Unity app?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,332
    It would probably be a separate platform-specific native code integration. There might be solutions on the asset store.
     
  3. GaeelBradshaw

    GaeelBradshaw

    Joined:
    Feb 26, 2021
    Posts:
    3
    I haven't found any, but maybe I'm looking for the wrong keywords

    Rolling out own solution would imply separate platform-specific native code integration that we'd need to maintain though OS updates and when we target new platforms, which sort of goes against why we're using Unity in the first place.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,332
    Agree. But accessibility is generally OS-specific.

    There might be something exposed in a library like Steamworks though.

    Since games are all over the place design wise, it probably doesn't make any sense for Unity to expose such an OS-specific generic design parameter to games, since every game designer I know doesn't want their game design messed with under any circumstances.

    I would recommend just doing your own settings that the user can choose larger fonts, sharper contrast, less reliance on colors, etc.
     
  5. GaeelBradshaw

    GaeelBradshaw

    Joined:
    Feb 26, 2021
    Posts:
    3
    Literally all I want is something that tells me what the preferences are, that totally makes sense for Unity to expose. Just an API that I can query and it tells me what the user's "prefer-contrast" is.
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,332
    If there was a business case or strong user demand for it, I'm sure they would.

    Go nuts. It is totally doable. Help yourself. Native integrations are a thing for sure. In fact, our team integrates and maintains over 100 different OS-level integrations, at a non-trivial engineering cost.

    https://docs.unity3d.com/Manual/NativePlugins.html

    That's how OS-level integrations work.