コード例 #1
0
        public void OnProcessScene(SceneManagement.Scene scene)
#endif
        {
            // In addition to the build process, OnProcessScene is also called on the current scene
            // when entering playmode in the Editor, but without OnPreprocessBuild.
            // Since we only want to generate a link.xml when building with the IL2CPP scripting
            // backend, we need to check for both conditions.
            if (buildingPlayer && isIL2CPPBuild())
            {
                foreach (var root in scene.GetRootGameObjects())
                {
                    foreach (var rs in root.GetComponentsInChildren <RemoteSettings>())
                    {
                        DriveableProperty dp = rs.driveableProperty;
                        AddTypesToHash(dp.fields, types);
                    }
                }

                // OnPostprocessBuild is called after assemblies are already stripped
                // so we need to write the link.xml file immediately after the last scene
                // is processed.
                if (scene.path == lastActiveScene)
                {
                    WriteLinkXml(types);
                    types = null;
                    // I can't tell the lifecycle of this class, so set this to false just in case.
                    buildingPlayer = false;
                }
            }
        }
コード例 #2
0
        private static void EditorUpdateManager_OnSceneOpened(SceneManagement.Scene scene, OpenSceneMode mode)
        {
            if (OpenSceneMode.Single != mode)
            {
                return;
            }


            ResetImageLoading();
        }
コード例 #3
0
 private void SceneManager_sceneUnloaded(SceneManagement.Scene scene)
 {
     SceneManagement.SceneManager.sceneUnloaded -= SceneManager_sceneUnloaded;
     if (m_logOnSceneUnloaded)
     {
         Debug.Log($"UISELECTORS_STATS: {scene.name}.Unloading log began");
         Log();
         Debug.Log($"UISELECTORS_STATS: {scene.name}.Unloading log ended");
     }
 }
コード例 #4
0
        public static string GetBakedTextureFilePath(
            ProbeSettings.ProbeType probeType,
            int index,
            SceneManagement.Scene scene
            )
        {
            var cacheDirectory = GetBakedTextureDirectory(scene);
            var targetFile     = Path.Combine(
                cacheDirectory,
                string.Format(k_HDProbeAssetFormat, probeType, index)
                );

            return(targetFile);
        }
コード例 #5
0
        public static string GetBakedTextureDirectory(SceneManagement.Scene scene)
        {
            var scenePath = scene.path;

            if (string.IsNullOrEmpty(scenePath))
            {
                return(string.Empty);
            }

            var cacheDirectoryName = Path.GetFileNameWithoutExtension(scenePath);
            var cacheDirectory     = Path.Combine(Path.GetDirectoryName(scenePath), cacheDirectoryName);

            return(cacheDirectory);
        }
コード例 #6
0
        static void AddOccluders()
        {
            ms_AddedOccluders = new List <MeshCollider>();

            for (int sceneIndex = 0; sceneIndex < SceneManagement.SceneManager.sceneCount; ++sceneIndex)
            {
                SceneManagement.Scene scene = SceneManagement.SceneManager.GetSceneAt(sceneIndex);
                if (!scene.isLoaded)
                {
                    continue;
                }

                GameObject[] gameObjects = scene.GetRootGameObjects();
                foreach (GameObject gameObject in gameObjects)
                {
                    MeshRenderer[] renderComponents = gameObject.GetComponentsInChildren <MeshRenderer>();
                    foreach (MeshRenderer mr in renderComponents)
                    {
                        if ((GameObjectUtility.GetStaticEditorFlags(mr.gameObject) & StaticEditorFlags.ContributeGI) != 0 && !mr.gameObject.TryGetComponent <MeshCollider>(out _))
                        {
                            var meshCollider = mr.gameObject.AddComponent <MeshCollider>();
                            meshCollider.hideFlags |= HideFlags.DontSaveInEditor | HideFlags.DontSaveInBuild;

                            ms_AddedOccluders.Add(meshCollider);
                        }
                    }
                }
            }

            var autoSimState = Physics.autoSimulation;

            try
            {
                if (autoSimState)
                {
                    Physics.autoSimulation = false;
                }

                Physics.Simulate(0.1f);
            }
            finally
            {
                if (autoSimState)
                {
                    Physics.autoSimulation = true;
                }
            }
        }
コード例 #7
0
 public void OnProcessScene(SceneManagement.Scene scene, BuildReport report)
コード例 #8
0
 private static void EditorUpdateManager_OnSceneCreated(SceneManagement.Scene scene, NewSceneSetup setup, NewSceneMode mode)
 {
     //Reset all imageLoading process when creating a new scene
     ResetImageLoading();
 }
コード例 #9
0
 private static void EditorUpdateManager_OnSceneClosed(SceneManagement.Scene scene)
 {
     //Reset all imageLoading process when closing the scene
     ResetImageLoading();
 }
コード例 #10
0
 public void OnProcessScene(SceneManagement.Scene scene)