diff --git a/src/UI/Models/ObjectPool/IPooledObject.cs b/src/UI/Models/ObjectPool/IPooledObject.cs deleted file mode 100644 index 9ffd3b6..0000000 --- a/src/UI/Models/ObjectPool/IPooledObject.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using UnityEngine; - -namespace UnityExplorer.UI.Models -{ - public interface IPooledObject - { - GameObject UIRoot { get; set; } - - GameObject CreateContent(GameObject parent); - - float DefaultHeight { get; } - - //GameObject CreatePrototype(); - } -} \ No newline at end of file diff --git a/src/UI/Models/ObjectPool/Pool.cs b/src/UI/Pool.cs similarity index 94% rename from src/UI/Models/ObjectPool/Pool.cs rename to src/UI/Pool.cs index 1ab92f3..74edc98 100644 --- a/src/UI/Models/ObjectPool/Pool.cs +++ b/src/UI/Pool.cs @@ -4,9 +4,16 @@ using System.Linq; using System.Text; using UnityEngine; -namespace UnityExplorer.UI.Models +namespace UnityExplorer.UI { - // Abstract non-generic class, handles the pool dictionary and interfacing with the generic pools. + public interface IPooledObject + { + GameObject UIRoot { get; set; } + float DefaultHeight { get; } + + GameObject CreateContent(GameObject parent); + } + public abstract class Pool { protected static readonly Dictionary pools = new Dictionary(); @@ -39,7 +46,6 @@ namespace UnityExplorer.UI.Models protected abstract void TryReturn(IPooledObject obj); } - // Each generic implementation has its own pool, business logic is here public class Pool : Pool where T : IPooledObject { public static Pool GetPool() => (Pool)GetPool(typeof(T)); diff --git a/src/UnityExplorer.csproj b/src/UnityExplorer.csproj index b95885f..577636f 100644 --- a/src/UnityExplorer.csproj +++ b/src/UnityExplorer.csproj @@ -290,8 +290,7 @@ - - +