Search Unity

PlayerSettings.SetPropertyString not working

Discussion in 'Immediate Mode GUI (IMGUI)' started by b4th, Nov 14, 2016.

  1. b4th

    b4th

    Joined:
    Jul 4, 2016
    Posts:
    65
    I'm trying to put together an editor script to automatically build to a VR device. In Unity 5.4, heterogeneous support was added for multiple VR SDKs, so setting PlayerSettings.virtualRealitySupported = true is no longer enough to prepare a VR-ready build - the specific supported SDKs need to be selected.

    From looking through the PlayerSettings API, I stumbled across the deprecated property PlayerSettings.stereoscopic3D, which had the following [Obsolete] message:

    "Use SetPropertyString("VR::devices", "stereo") instead"

    This gave me hope that this property string might define the list of supported VR SDKs. I tried calling this method, but was thrown the following error message:

    "EditorOnlyPlayerSettings property VR::devices::VR::devices not inititalized." [sic]

    I had the same issue when trying to read the value with GetPropertyString. When calling the method with a specific build target, i.e. Android, I got the following error message:

    "EditorOnlyPlayerSettings property Android::VR::devices not inititalized."

    I suspect that there is an issue in the PlayerSettings SetPropertyString and GetPropertyString methods, where settings that apply to all platforms (BuildTargetGroup.Unknown), are not having their key constructed properly - the input string is being concatenated with itself (VR::devices::VR::devices) instead of being left unmodified (VR::devices).

    Can anybody at Unity confirm this issue? Is there a fix coming in the near future, possibly in the next Daydream Technical Preview?
     
    Sergsar likes this.
  2. Sergsar

    Sergsar

    Joined:
    Mar 1, 2018
    Posts:
    4
    No changes.
    Trying to disable HW Statistics through API
    PlayerSettings.SetPropertyBool("submitAnalytics", true, BuildTargetGroup.Unknown)
    Throws error:
    Unknown Property: 'submitAnalytics::submitAnalytics'
    Furthermore: compiler outputs 'deprecated' warning. But no ability to set this setting through API.