示例#1
0
        void OnValidate()
        {
            ValidationUtility.SafeOnValidate(() =>
            {
                if (initialized && priorEnabled == vrEnabled || !settings)
                {
                    return;
                }

                settings.InitManagerOnStart = vrEnabled;
                Relay.Invoke(vrEnabled);

                initialized  = true;
                priorEnabled = vrEnabled;

                if (activeInFlatscreen == null || activeInVr == null)
                {
                    return;
                }

                foreach (var item in activeInFlatscreen)
                {
                    item.SetActive(!vrEnabled);
                }
                foreach (var item in activeInVr)
                {
                    item.SetActive(vrEnabled);
                }
            });
        }