GetInstanceResolution() private method

private GetInstanceResolution ( Renderer renderer, int &width, int &height ) : bool
renderer UnityEngine.Renderer
width int
height int
return bool
        private void ShowRealtimeLMGUI(SerializedObject so, Renderer renderer)
        {
            Hash128 hash;
            Hash128 hash2;
            int     num;
            int     num2;
            Hash128 hash3;
            int     num3;
            int     num4;

            EditorGUI.indentLevel++;
            if (LightmapEditorSettings.GetInstanceHash(renderer, out hash))
            {
                EditorGUILayout.LabelField(s_Styles.RealtimeLMInstanceHash, new GUIContent(hash.ToString()), new GUILayoutOption[0]);
            }
            if (LightmapEditorSettings.GetGeometryHash(renderer, out hash2))
            {
                EditorGUILayout.LabelField(s_Styles.RealtimeLMGeometryHash, new GUIContent(hash2.ToString()), new GUILayoutOption[0]);
            }
            if (LightmapEditorSettings.GetInstanceResolution(renderer, out num, out num2))
            {
                EditorGUILayout.LabelField(s_Styles.RealtimeLMInstanceResolution, new GUIContent(num.ToString() + "x" + num2.ToString()), new GUILayoutOption[0]);
            }
            if (LightmapEditorSettings.GetInputSystemHash(renderer, out hash3))
            {
                EditorGUILayout.LabelField(s_Styles.RealtimeLMInputSystemHash, new GUIContent(hash3.ToString()), new GUILayoutOption[0]);
            }
            if (LightmapEditorSettings.GetSystemResolution(renderer, out num3, out num4))
            {
                EditorGUILayout.LabelField(s_Styles.RealtimeLMResolution, new GUIContent(num3.ToString() + "x" + num4.ToString()), new GUILayoutOption[0]);
            }
            EditorGUI.indentLevel--;
        }
示例#2
0
        void ShowRealtimeLMGUI(Renderer renderer)
        {
            EditorGUI.indentLevel += 1;

            // The hash of the instance.
            Hash128 instanceHash;

            if (LightmapEditorSettings.GetInstanceHash(renderer, out instanceHash))
            {
                EditorGUILayout.LabelField(s_Styles.RealtimeLMInstanceHash, GUIContent.Temp(instanceHash.ToString()));
            }

            // The hash of the geometry.
            Hash128 geometryHash;

            if (LightmapEditorSettings.GetGeometryHash(renderer, out geometryHash))
            {
                EditorGUILayout.LabelField(s_Styles.RealtimeLMGeometryHash, GUIContent.Temp(geometryHash.ToString()));
            }

            // Resolution of the packed instance.
            int instWidth, instHeight;

            if (LightmapEditorSettings.GetInstanceResolution(renderer, out instWidth, out instHeight))
            {
                EditorGUILayout.LabelField(s_Styles.RealtimeLMInstanceResolution, GUIContent.Temp(instWidth.ToString() + "x" + instHeight.ToString()));
            }

            // The hash of the system.
            Hash128 inputSystemHash;

            if (LightmapEditorSettings.GetInputSystemHash(renderer, out inputSystemHash))
            {
                EditorGUILayout.LabelField(s_Styles.RealtimeLMInputSystemHash, GUIContent.Temp(inputSystemHash.ToString()));
            }

            // Resolution of the system.
            int width, height;

            if (LightmapEditorSettings.GetSystemResolution(renderer, out width, out height))
            {
                EditorGUILayout.LabelField(s_Styles.RealtimeLMResolution, GUIContent.Temp(width.ToString() + "x" + height.ToString()));
            }

            EditorGUI.indentLevel -= 1;
        }
        void ShowRealtimeLMGUI(Renderer renderer)
        {
            EditorGUI.indentLevel += 1;

            Hash128 inputSystemHash = new Hash128();

            if (renderer != null && LightmapEditorSettings.GetInputSystemHash(renderer.GetInstanceID(), out inputSystemHash))
            {
                ShowRealtimeLightmapPreview(inputSystemHash);
            }

            int instWidth, instHeight;

            if (LightmapEditorSettings.GetInstanceResolution(renderer, out instWidth, out instHeight))
            {
                EditorGUILayout.LabelField(Styles.RealtimeLMInstanceResolution, GUIContent.Temp(instWidth.ToString() + "x" + instHeight.ToString()));
            }

            int width, height;

            if (LightmapEditorSettings.GetSystemResolution(renderer, out width, out height))
            {
                EditorGUILayout.LabelField(Styles.RealtimeLMResolution, GUIContent.Temp(width.ToString() + "x" + height.ToString()));
            }

            if (Unsupported.IsDeveloperMode())
            {
                Hash128 instanceHash;
                if (LightmapEditorSettings.GetInstanceHash(renderer, out instanceHash))
                {
                    EditorGUILayout.LabelField(Styles.RealtimeLMInstanceHash, GUIContent.Temp(instanceHash.ToString()));
                }

                Hash128 geometryHash;
                if (LightmapEditorSettings.GetGeometryHash(renderer, out geometryHash))
                {
                    EditorGUILayout.LabelField(Styles.RealtimeLMGeometryHash, GUIContent.Temp(geometryHash.ToString()));
                }

                EditorGUILayout.LabelField(Styles.RealtimeLMInputSystemHash, GUIContent.Temp(inputSystemHash.ToString()));
            }

            EditorGUI.indentLevel -= 1;
        }
        private void ShowRealtimeLMGUI(SerializedObject so, Renderer renderer)
        {
            ++EditorGUI.indentLevel;
            Hash128 instanceHash;

            if (LightmapEditorSettings.GetInstanceHash(renderer, out instanceHash))
            {
                EditorGUILayout.LabelField(LightingWindowObjectTab.s_Styles.RealtimeLMInstanceHash, new GUIContent(instanceHash.ToString()), new GUILayoutOption[0]);
            }
            Hash128 geometryHash;

            if (LightmapEditorSettings.GetGeometryHash(renderer, out geometryHash))
            {
                EditorGUILayout.LabelField(LightingWindowObjectTab.s_Styles.RealtimeLMGeometryHash, new GUIContent(geometryHash.ToString()), new GUILayoutOption[0]);
            }
            int width1;
            int height1;

            if (LightmapEditorSettings.GetInstanceResolution(renderer, out width1, out height1))
            {
                EditorGUILayout.LabelField(LightingWindowObjectTab.s_Styles.RealtimeLMInstanceResolution, new GUIContent(width1.ToString() + "x" + height1.ToString()), new GUILayoutOption[0]);
            }
            Hash128 inputSystemHash;

            if (LightmapEditorSettings.GetInputSystemHash(renderer, out inputSystemHash))
            {
                EditorGUILayout.LabelField(LightingWindowObjectTab.s_Styles.RealtimeLMInputSystemHash, new GUIContent(inputSystemHash.ToString()), new GUILayoutOption[0]);
            }
            int width2;
            int height2;

            if (LightmapEditorSettings.GetSystemResolution(renderer, out width2, out height2))
            {
                EditorGUILayout.LabelField(LightingWindowObjectTab.s_Styles.RealtimeLMResolution, new GUIContent(width2.ToString() + "x" + height2.ToString()), new GUILayoutOption[0]);
            }
            --EditorGUI.indentLevel;
        }
示例#5
0
        void ShowRealtimeLMGUI(Renderer renderer)
        {
            Hash128 inputSystemHash;

            if (renderer == null || !LightmapEditorSettings.GetInputSystemHash(renderer.GetInstanceID(), out inputSystemHash) || inputSystemHash == new Hash128())
            {
                return; // early return since we don't have any lightmaps for it
            }
            if (!UpdateRealtimeTexture(inputSystemHash, renderer.GetInstanceID()))
            {
                return;
            }

            m_ShowRealtimeLM.value = EditorGUILayout.Foldout(m_ShowRealtimeLM.value, Styles.RealtimeLM, true);

            if (!m_ShowRealtimeLM.value)
            {
                return;
            }

            EditorGUI.indentLevel += 1;

            GUILayout.BeginHorizontal();

            DrawLightmapPreview(m_CachedRealtimeTexture.texture, true, renderer.GetInstanceID());

            GUILayout.BeginVertical();

            int instWidth, instHeight;

            if (LightmapEditorSettings.GetInstanceResolution(renderer, out instWidth, out instHeight))
            {
                GUILayout.Label(Styles.RealtimeLMInstanceResolution.text + ": " + instWidth.ToString() + "x" + instHeight.ToString());
            }

            int width, height;

            if (LightmapEditorSettings.GetSystemResolution(renderer, out width, out height))
            {
                GUILayout.Label(Styles.RealtimeLMResolution.text + ": " + width.ToString() + "x" + height.ToString());
            }

            GUILayout.EndVertical();
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();

            if (Unsupported.IsDeveloperMode())
            {
                Hash128 instanceHash;
                if (LightmapEditorSettings.GetInstanceHash(renderer, out instanceHash))
                {
                    EditorGUILayout.LabelField(Styles.RealtimeLMInstanceHash, GUIContent.Temp(instanceHash.ToString()));
                }

                Hash128 geometryHash;
                if (LightmapEditorSettings.GetGeometryHash(renderer, out geometryHash))
                {
                    EditorGUILayout.LabelField(Styles.RealtimeLMGeometryHash, GUIContent.Temp(geometryHash.ToString()));
                }

                EditorGUILayout.LabelField(Styles.RealtimeLMInputSystemHash, GUIContent.Temp(inputSystemHash.ToString()));
            }

            EditorGUI.indentLevel -= 1;

            GUILayout.Space(5);
        }