@@ -30,9 +30,14 @@ public static class SpawnManager
3030 public delegate void DestroyHandlerDelegate ( NetworkedObject networkedObject ) ;
3131
3232
33- private static readonly Dictionary < ulong , SpawnHandlerDelegate > customSpawnHandlers = new Dictionary < ulong , SpawnHandlerDelegate > ( ) ;
33+ internal static readonly Dictionary < ulong , SpawnHandlerDelegate > customSpawnHandlers = new Dictionary < ulong , SpawnHandlerDelegate > ( ) ;
3434 internal static readonly Dictionary < ulong , DestroyHandlerDelegate > customDestroyHandlers = new Dictionary < ulong , DestroyHandlerDelegate > ( ) ;
3535
36+ /// <summary>
37+ /// Registers a delegate for spawning networked prefabs, useful for object pooling
38+ /// </summary>
39+ /// <param name="prefabHash">The prefab hash to spawn</param>
40+ /// <param name="handler">The delegate handler</param>
3641 public static void RegisterSpawnHandler ( ulong prefabHash , SpawnHandlerDelegate handler )
3742 {
3843 if ( customSpawnHandlers . ContainsKey ( prefabHash ) )
@@ -45,6 +50,11 @@ public static void RegisterSpawnHandler(ulong prefabHash, SpawnHandlerDelegate h
4550 }
4651 }
4752
53+ /// <summary>
54+ /// Registers a delegate for destroying networked objects, useful for object pooling
55+ /// </summary>
56+ /// <param name="prefabHash">The prefab hash to destroy</param>
57+ /// <param name="handler">The delegate handler</param>
4858 public static void RegisterCustomDestroyHandler ( ulong prefabHash , DestroyHandlerDelegate handler )
4959 {
5060 if ( customDestroyHandlers . ContainsKey ( prefabHash ) )
@@ -57,11 +67,19 @@ public static void RegisterCustomDestroyHandler(ulong prefabHash, DestroyHandler
5767 }
5868 }
5969
70+ /// <summary>
71+ /// Removes the custom spawn handler for a specific prefab hash
72+ /// </summary>
73+ /// <param name="prefabHash">The prefab hash of the prefab spawn handler that is to be removed</param>
6074 public static void RemoveCustomSpawnHandler ( ulong prefabHash )
6175 {
6276 customSpawnHandlers . Remove ( prefabHash ) ;
6377 }
6478
79+ /// <summary>
80+ /// Removes the custom destroy handler for a specific prefab hash
81+ /// </summary>
82+ /// <param name="prefabHash">The prefab hash of the prefab destroy handler that is to be removed</param>
6583 public static void RemoveCustomDestroyHandler ( ulong prefabHash )
6684 {
6785 customDestroyHandlers . Remove ( prefabHash ) ;
0 commit comments