From e7dfbec8e8634e767d78959941daf71a96e021cf Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 7 Apr 2021 19:10:30 +0800 Subject: =?UTF-8?q?*=E7=A7=BB=E5=8A=A8=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UnityEngine.UI/UI/Core/GraphicRegistry.cs | 76 ---------------------- 1 file changed, 76 deletions(-) delete mode 100644 Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/GraphicRegistry.cs (limited to 'Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/GraphicRegistry.cs') diff --git a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/GraphicRegistry.cs b/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/GraphicRegistry.cs deleted file mode 100644 index ca7eddf..0000000 --- a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/GraphicRegistry.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System.Collections.Generic; -using UnityEngine.UI.Collections; - -namespace UnityEngine.UI -{ - public class GraphicRegistry - { - private static GraphicRegistry s_Instance; - - private readonly Dictionary> m_Graphics = new Dictionary>(); - - protected GraphicRegistry() - { - // This is needed for AOT on IOS. Without it the compile doesn't get the definition of the Dictionarys -#pragma warning disable 168 - Dictionary emptyGraphicDic; - Dictionary emptyElementDic; -#pragma warning restore 168 - } - - public static GraphicRegistry instance - { - get - { - if (s_Instance == null) - s_Instance = new GraphicRegistry(); - return s_Instance; - } - } - - public static void RegisterGraphicForCanvas(Canvas c, Graphic graphic) - { - if (c == null) - return; - - IndexedSet graphics; - instance.m_Graphics.TryGetValue(c, out graphics); - - if (graphics != null) - { - graphics.AddUnique(graphic); - return; - } - - // Dont need to AddUnique as we know its the only item in the list - graphics = new IndexedSet(); - graphics.Add(graphic); - instance.m_Graphics.Add(c, graphics); - } - - public static void UnregisterGraphicForCanvas(Canvas c, Graphic graphic) - { - if (c == null) - return; - - IndexedSet graphics; - if (instance.m_Graphics.TryGetValue(c, out graphics)) - { - graphics.Remove(graphic); - - if (graphics.Count == 0) - instance.m_Graphics.Remove(c); - } - } - - private static readonly List s_EmptyList = new List(); - public static IList GetGraphicsForCanvas(Canvas canvas) - { - IndexedSet graphics; - if (instance.m_Graphics.TryGetValue(canvas, out graphics)) - return graphics; - - return s_EmptyList; - } - } -} -- cgit v1.1-26-g67d0