File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Assets/Scripts/Utils/Html Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 1
1
using System . Collections . Generic ;
2
+ using TMPro ;
2
3
using UnityEngine ;
3
4
4
5
namespace FairyGUI . Utils
@@ -14,15 +15,25 @@ public class HtmlPageContext : IHtmlPageContext
14
15
Stack < IHtmlObject > _selectPool ;
15
16
Stack < IHtmlObject > _linkPool ;
16
17
17
- public static HtmlPageContext inst = new HtmlPageContext ( ) ;
18
+ static HtmlPageContext _inst ;
19
+
20
+ public static HtmlPageContext inst
21
+ {
22
+ get
23
+ {
24
+ if ( _inst == null )
25
+ _inst = new HtmlPageContext ( ) ;
26
+ return _inst ;
27
+ }
28
+ }
18
29
19
30
static Transform _poolManager ;
20
31
21
32
#if UNITY_2019_3_OR_NEWER
22
33
[ RuntimeInitializeOnLoadMethod ( RuntimeInitializeLoadType . SubsystemRegistration ) ]
23
34
static void InitializeOnLoad ( )
24
35
{
25
- inst = new HtmlPageContext ( ) ;
36
+ _inst = null ;
26
37
_poolManager = null ;
27
38
}
28
39
#endif
You can’t perform that action at this time.
0 commit comments