graphy icon indicating copy to clipboard operation
graphy copied to clipboard

IndexOutOfRangeException running on Device Simulator in Unity 2022.3

Open micsanbr opened this issue 1 year ago • 0 comments

Running on Unity 2022.3.0 with AR Foundation and URP. Graphy installed via git url in package manager.

Looks related to issue #107.

File com.tayx.graphy@38d5399c46\Runtime\Advanced\G_AdvancedData.cs

Error at line 330 IndexOutOfRangeException: Index was outside the bounds of the array.

            m_screenResolutionText.text
                = "Screen: "
                  + res.width
                  + "x"
                  + res.height
                  + "@"
#if UNITY_2022_2_OR_NEWER
                  + ((int)Screen.currentResolution.refreshRateRatio.value).ToStringNonAlloc()
#else
                  + res.refreshRate
#endif
                  + "Hz";

// print((Screen.currentResolution)); // prints 2048 x 1536 @ NaNHz
// print((Screen.currentResolution.refreshRateRatio.value)); // prints NaN

Error at line 108 IndexOutOfRangeException: Index was outside the bounds of the array.

                m_sb.Append( m_windowStrings[ 0 ] ).Append( Screen.width.ToStringNonAlloc() )
                    .Append( m_windowStrings[ 1 ] ).Append( Screen.height.ToStringNonAlloc() )
                    .Append( m_windowStrings[ 2 ] ).Append(
#if UNITY_2022_2_OR_NEWER
                        ((int)Screen.currentResolution.refreshRateRatio.value).ToStringNonAlloc()
#else
                        Screen.currentResolution.refreshRate.ToStringNonAlloc()
#endif
                        )
                    .Append( m_windowStrings[ 3 ] )
                    .Append( m_windowStrings[ 4 ] ).Append( ((int) Screen.dpi).ToStringNonAlloc() )
                    .Append( m_windowStrings[ 5 ] );

Editor + Game view: Graphy runs fine. Editor + Simulator view: Graphy halts and pauses the editor. After pressing the play button, it resumes and shows placeholder hashtag characters instead of showing the Hz value.

micsanbr avatar Dec 08 '23 18:12 micsanbr