Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit bfa73bc

Browse files
committed
Cleanup Pool.cs
1 parent b0bbeb3 commit bfa73bc

File tree

3 files changed

+10
-24
lines changed

3 files changed

+10
-24
lines changed

src/UI/Models/ObjectPool/IPooledObject.cs

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/UI/Models/ObjectPool/Pool.cs renamed to src/UI/Pool.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@
44
using System.Text;
55
using UnityEngine;
66

7-
namespace UnityExplorer.UI.Models
7+
namespace UnityExplorer.UI
88
{
9-
// Abstract non-generic class, handles the pool dictionary and interfacing with the generic pools.
9+
public interface IPooledObject
10+
{
11+
GameObject UIRoot { get; set; }
12+
float DefaultHeight { get; }
13+
14+
GameObject CreateContent(GameObject parent);
15+
}
16+
1017
public abstract class Pool
1118
{
1219
protected static readonly Dictionary<Type, Pool> pools = new Dictionary<Type, Pool>();
@@ -39,7 +46,6 @@ public static void Return(Type type, IPooledObject obj)
3946
protected abstract void TryReturn(IPooledObject obj);
4047
}
4148

42-
// Each generic implementation has its own pool, business logic is here
4349
public class Pool<T> : Pool where T : IPooledObject
4450
{
4551
public static Pool<T> GetPool() => (Pool<T>)GetPool(typeof(T));

src/UnityExplorer.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,7 @@
290290
<Compile Include="UI\Inspectors\ReflectionInspector.cs" />
291291
<Compile Include="UI\CacheObject\IValues\InteractiveValueStruct.cs" />
292292
<Compile Include="UI\Models\InputFieldRef.cs" />
293-
<Compile Include="UI\Models\ObjectPool\IPooledObject.cs" />
294-
<Compile Include="UI\Models\ObjectPool\Pool.cs" />
293+
<Compile Include="UI\Pool.cs" />
295294
<Compile Include="UI\Panels\LogPanel.cs" />
296295
<Compile Include="UI\Panels\CSConsolePanel.cs" />
297296
<Compile Include="Core\Utility\IOUtility.cs" />

0 commit comments

Comments
 (0)