protected override void OnGUISceneCheck(VRC.SDKBase.VRC_SceneDescriptor scene)
        {
            base.OnGUISceneCheck(scene);

            foreach (VRC_DataStorage ds in Object.FindObjectsOfType <VRC_DataStorage>())
            {
                VRCSDK2.VRC_ObjectSync os = ds.GetComponent <VRCSDK2.VRC_ObjectSync>();
                if (os != null && os.SynchronizePhysics)
                {
                    _builder.OnGUIWarning(scene, ds.name + " has a VRC_DataStorage and VRC_ObjectSync, with SynchronizePhysics enabled.",
                                          delegate { Selection.activeObject = os.gameObject; }, null);
                }
            }
        }
예제 #2
0
        protected override void OnGUISceneCheck(VRC.SDKBase.VRC_SceneDescriptor scene)
        {
            base.OnGUISceneCheck(scene);

            var resyncNotEnabled = Object.FindObjectsOfType <VRC.SDK3.Video.Components.Base.BaseVRCVideoPlayer>().Where(vp => !vp.EnableAutomaticResync).ToArray();

            if (resyncNotEnabled.Length > 0)
            {
                _builder.OnGUIWarning(null,
                                      "Video Players do not have automatic resync enabled; audio may become desynchronized from video during low performance.",
                                      () =>
                {
                    Selection.objects = resyncNotEnabled.Select(s => s.gameObject).Cast <Object>().ToArray();
                },
                                      () =>
                {
                    foreach (var vp in resyncNotEnabled)
                    {
                        vp.EnableAutomaticResync = true;
                    }
                });
            }

            foreach (VRC.SDK3.Components.VRCObjectSync os in Object.FindObjectsOfType <VRC.SDK3.Components.VRCObjectSync>())
            {
                if (os.GetComponents <VRC.Udon.UdonBehaviour>().Any((ub) => ub.SyncIsManual))
                {
                    _builder.OnGUIError(scene, "Object Sync cannot share an object with a manually synchronized Udon Behaviour",
                                        delegate { Selection.activeObject = os.gameObject; }, null);
                }
                if (os.GetComponent <VRC.SDK3.Components.VRCObjectPool>() != null)
                {
                    _builder.OnGUIError(scene, "Object Sync cannot share an object with an object pool",
                                        delegate { Selection.activeObject = os.gameObject; }, null);
                }
            }
        }