public void OnProcessScene(UnityEngine.SceneManagement.Scene scene, Build.Reporting.BuildReport report)
        {
            int staticBatching, dynamicBatching;

            PlayerSettings.GetBatchingForPlatform(EditorUserBuildSettings.activeBuildTarget, out staticBatching, out dynamicBatching);
            if (staticBatching != 0)
            {
                InternalStaticBatchingUtility.Combine(null, true, true);
            }
        }
Example #2
0
            public static void OnPostprocessScene()
            {
                int num;
                int num2;

                PlayerSettings.GetBatchingForPlatform(EditorUserBuildSettings.activeBuildTarget, out num, out num2);
                if (num != 0 && PlayerSettings.advancedLicense)
                {
                    InternalStaticBatchingUtility.Combine(null, true);
                }
            }
        public void OnProcessScene(Scene scene, BuildReport report)
        {
            int num;
            int num2;

            PlayerSettings.GetBatchingForPlatform(EditorUserBuildSettings.activeBuildTarget, out num, out num2);
            if (num != 0)
            {
                InternalStaticBatchingUtility.Combine(null, true, true);
            }
        }
            public static void OnPostprocessScene()
            {
                int staticBatching;
                int dynamicBatching;

                PlayerSettings.GetBatchingForPlatform(EditorUserBuildSettings.activeBuildTarget, out staticBatching, out dynamicBatching);
                if (staticBatching == 0)
                {
                    return;
                }
                InternalStaticBatchingUtility.Combine((GameObject)null, true, true);
            }
        public void OnProcessScene(UnityEngine.SceneManagement.Scene scene, Build.Reporting.BuildReport report)
        {
            int staticBatching, dynamicBatching;

            PlayerSettings.GetBatchingForPlatform(EditorUserBuildSettings.activeBuildTarget, out staticBatching, out dynamicBatching);
            if (staticBatching != 0)
            {
                using (StaticBatchingUtility.s_CombineMarker.Auto())
                {
                    ulong sceneHash = Hash128.Compute(AssetDatabase.AssetPathToGUID(scene.path)).u64_0;
                    StaticBatchingEditorHelper.CombineAllStaticMeshesForScenePostProcessing(sceneHash, scene);
                }
            }
        }
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            // Evaluate displayMaterialWarning before drawing properties to avoid mismatched layout group
            bool displayMaterialWarning = false;

            if (!m_Materials.hasMultipleDifferentValues)
            {
                MeshFilter mf = ((MeshRenderer)serializedObject.targetObject).GetComponent <MeshFilter>();
                displayMaterialWarning = mf != null && mf.sharedMesh != null && m_Materials.arraySize > mf.sharedMesh.subMeshCount;
            }

            using (new EditorGUI.DisabledScope(((MeshRenderer)serializedObject.targetObject).GetComponent <Tree>() != null))
            {
                DrawMaterials();
            }

            if (!m_Materials.hasMultipleDifferentValues && displayMaterialWarning)
            {
                EditorGUILayout.HelpBox(Styles.materialWarning.text, MessageType.Warning, true);
            }

            if (ShaderUtil.MaterialsUseInstancingShader(m_Materials))
            {
                m_GameObjectsSerializedObject.Update();

                int staticBatching, dynamicBatching;
                PlayerSettings.GetBatchingForPlatform(EditorUserBuildSettings.activeBuildTarget, out staticBatching, out dynamicBatching);

                if (!m_GameObjectStaticFlags.hasMultipleDifferentValues && ((StaticEditorFlags)m_GameObjectStaticFlags.intValue & StaticEditorFlags.BatchingStatic) != 0 && staticBatching != 0)
                {
                    EditorGUILayout.HelpBox(Styles.staticBatchingWarning.text, MessageType.Warning, true);
                }
            }

            LightingSettingsGUI(true);
            RayTracingSettingsGUI();
            OtherSettingsGUI(true, false, false);

            if (targets.Length == 1)
            {
                SpeedTreeMaterialFixer.DoFixerUI((target as MeshRenderer).gameObject);
            }

            serializedObject.ApplyModifiedProperties();
        }