55using System . Globalization ;
66using UnityEngine ;
77using UnityEngine . SceneManagement ;
8+
9+ [ assembly: System . Runtime . CompilerServices . InternalsVisibleTo ( "Backtrace.Unity.Tests.Runtime" ) ]
810namespace Backtrace . Unity . Model . JsonData
911{
1012 /// <summary>
@@ -15,14 +17,24 @@ public class Annotations
1517 /// <summary>
1618 /// Backward compatibility helper
1719 /// </summary>
18- private static Dictionary < string , string > _environmentVariablesCache ;
20+ internal static Dictionary < string , string > _environmentVariablesCache ;
21+
22+ /// <summary>
23+ /// Determinate if static helper should load environment variables or not.
24+ /// </summary>
25+ internal static bool VariablesLoaded ;
26+
27+ /// <summary>
28+ /// Loaded environment variables
29+ /// </summary>
1930 public static Dictionary < string , string > EnvironmentVariablesCache
2031 {
2132 get
2233 {
23- if ( _environmentVariablesCache == null )
34+ if ( VariablesLoaded == false )
2435 {
2536 _environmentVariablesCache = SetEnvironmentVariables ( ) ;
37+ VariablesLoaded = true ;
2638 }
2739 return _environmentVariablesCache ;
2840 }
@@ -31,24 +43,19 @@ public static Dictionary<string, string> EnvironmentVariablesCache
3143 _environmentVariablesCache = value ;
3244 }
3345 }
46+
3447 /// <summary>
35- /// Backward compatibility helper
48+ /// Backward compatibility - local reference to environment variables
3649 /// </summary>
37- private Dictionary < string , string > _environmentVariables ;
38-
3950 public Dictionary < string , string > EnvironmentVariables
4051 {
4152 get
4253 {
43- if ( _environmentVariables == null )
44- {
45- _environmentVariables = EnvironmentVariablesCache ;
46- }
47- return _environmentVariables ;
54+ return EnvironmentVariablesCache ;
4855 }
4956 set
5057 {
51- _environmentVariables = value ;
58+ EnvironmentVariablesCache = value ;
5259 }
5360 }
5461 /// <summary>
0 commit comments