Skip to content

Commit

Permalink
fix a bug that sometime duplicate stage cameras
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoguzhu committed Mar 21, 2024
1 parent efcb909 commit 2f599be
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Assets/Scripts/Utils/Html/HtmlPageContext.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using TMPro;
using UnityEngine;

namespace FairyGUI.Utils
Expand All @@ -14,15 +15,25 @@ public class HtmlPageContext : IHtmlPageContext
Stack<IHtmlObject> _selectPool;
Stack<IHtmlObject> _linkPool;

public static HtmlPageContext inst = new HtmlPageContext();
static HtmlPageContext _inst;

public static HtmlPageContext inst
{
get
{
if (_inst == null)
_inst = new HtmlPageContext();
return _inst;
}
}

static Transform _poolManager;

#if UNITY_2019_3_OR_NEWER
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
static void InitializeOnLoad()
{
inst = new HtmlPageContext();
_inst = null;
_poolManager = null;
}
#endif
Expand Down

0 comments on commit 2f599be

Please sign in to comment.