Example #1
0
    private void Awake()
    {
        _settings = Resources.Load <AirXRServerSettings>("AirXRServerSettings");
        if (_settings == null)
        {
            _settings = ScriptableObject.CreateInstance <AirXRServerSettings>();
        }

        if (_settings.UseFoveatedRendering == false)
        {
            return;
        }

        OCSVRWorks.LoadOnce();
    }
    internal static void LoadOnce()
    {
        if (_instance == null)
        {
            GameObject go = new GameObject("AirXRServer");
            go.AddComponent <AirXRServer>();
            Assert.IsNotNull(_instance);

            var settings = Resources.Load <AirXRServerSettings>("AirXRServerSettings");
            if (settings == null)
            {
                settings = ScriptableObject.CreateInstance <AirXRServerSettings>();
            }
            _instance._settings = settings;
            _instance._settings.ParseCommandLineArgs(Environment.GetCommandLineArgs());
        }
    }
#pragma warning restore 414

    public void ReadSettings(string fileFrom, AirXRServerSettings to)
    {
        onairvr = to;
        JsonUtility.FromJsonOverwrite(File.ReadAllText(fileFrom), this);
    }