Skip to content

Commit f1e9d7c

Browse files
authored
Update DefaultObjectPool.cs
Avoid overwriting public API
1 parent 65a9d0f commit f1e9d7c

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Assets/FishNet/Runtime/Utility/Performance/DefaultObjectPool.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,26 @@ public override void StoreObject(NetworkObject instantiated, bool asServer)
164164
cache.Push(instantiated);
165165
}
166166

167+
/// <summary>
168+
/// Instantiates a number of objects and adds them to the pool.
169+
/// </summary>
170+
/// <param name="prefab">Prefab to cache.</param>
171+
/// <param name="count">Quantity to spawn.</param>
172+
/// <param name="asServer">True if storing prefabs for the server collection. This is only applicable when using DualPrefabObjects.</param>
173+
/// <returns></returns>
174+
public override void CacheObjects(NetworkObject prefab, int count, bool asServer)
175+
{
176+
GetCacheObjects(prefab, count, asServer);
177+
}
178+
167179
/// <summary>
168180
/// Instantiates a number of objects, adds them to the pool, and returns the objects.
169181
/// </summary>
170182
/// <param name="prefab">Prefab to cache.</param>
171183
/// <param name="count">Quantity to spawn.</param>
172184
/// <param name="asServer">True if storing prefabs for the server collection. This is only applicable when using DualPrefabObjects.</param>
173185
/// <returns></returns>
174-
public override Stack<NetworkObject> CacheObjects(NetworkObject prefab, int count, bool asServer)
186+
public Stack<NetworkObject> GetCacheObjects(NetworkObject prefab, int count, bool asServer)
175187
{
176188
if (!_enabled)
177189
return;
@@ -259,4 +271,4 @@ public Stack<NetworkObject> GetOrCreateCache(int collectionId, int prefabId)
259271
}
260272

261273

262-
}
274+
}

0 commit comments

Comments
 (0)