1
- using UnityEngine ;
1
+ using UnityEngine ;
2
2
3
3
namespace ToolBox . Pools
4
4
{
5
5
public static class PoolExtensions
6
6
{
7
- /// <summary>
8
- /// Use this method only with Prefabs
9
- /// </summary>
10
7
public static void Populate ( this GameObject prefab , int count )
11
8
{
12
9
var pool = Pool . Get ( prefab ) ;
13
10
pool . Populate ( count ) ;
14
11
}
15
12
16
- /// <summary>
17
- /// Use this method only with Prefabs
18
- /// </summary>
19
13
public static Poolable Spawn ( this GameObject prefab )
20
14
{
21
15
var pool = Pool . Get ( prefab ) ;
@@ -24,9 +18,6 @@ public static Poolable Spawn(this GameObject prefab)
24
18
return entity ;
25
19
}
26
20
27
- /// <summary>
28
- /// Use this method only with Prefabs
29
- /// </summary>
30
21
public static Poolable Spawn ( this GameObject prefab , Transform parent , bool spawnInWorldSpace )
31
22
{
32
23
var pool = Pool . Get ( prefab ) ;
@@ -35,9 +26,6 @@ public static Poolable Spawn(this GameObject prefab, Transform parent, bool spaw
35
26
return entity ;
36
27
}
37
28
38
- /// <summary>
39
- /// Use this method only with Prefabs
40
- /// </summary>
41
29
public static Poolable Spawn ( this GameObject prefab , Vector3 position , Quaternion rotation )
42
30
{
43
31
var pool = Pool . Get ( prefab ) ;
@@ -46,9 +34,6 @@ public static Poolable Spawn(this GameObject prefab, Vector3 position, Quaternio
46
34
return entity ;
47
35
}
48
36
49
- /// <summary>
50
- /// Use this method only with Prefabs
51
- /// </summary>
52
37
public static Poolable Spawn ( this GameObject prefab , Vector3 position , Quaternion rotation , Transform parent , bool spawnInWorldSpace )
53
38
{
54
39
var pool = Pool . Get ( prefab ) ;
@@ -57,27 +42,15 @@ public static Poolable Spawn(this GameObject prefab, Vector3 position, Quaternio
57
42
return entity ;
58
43
}
59
44
60
- /// <summary>
61
- /// Use this method only with Prefabs
62
- /// </summary>
63
45
public static T Spawn < T > ( this GameObject prefab ) where T : Component =>
64
46
prefab . Spawn ( ) . GetComponent < T > ( ) ;
65
47
66
- /// <summary>
67
- /// Use this method only with Prefabs
68
- /// </summary>
69
48
public static T Spawn < T > ( this GameObject prefab , Transform parent , bool spawnInWorldSpace ) where T : Component =>
70
49
prefab . Spawn ( parent , spawnInWorldSpace ) . GetComponent < T > ( ) ;
71
50
72
- /// <summary>
73
- /// Use this method only with Prefabs
74
- /// </summary>
75
51
public static T Spawn < T > ( this GameObject prefab , Vector3 position , Quaternion rotation ) where T : Component =>
76
52
prefab . Spawn ( position , rotation ) . GetComponent < T > ( ) ;
77
53
78
- /// <summary>
79
- /// Use this method only with Prefabs
80
- /// </summary>
81
54
public static T Spawn < T > ( this GameObject prefab , Vector3 position , Quaternion rotation , Transform parent , bool spawnInWorldSpace ) where T : Component =>
82
55
prefab . Spawn ( position , rotation , parent , spawnInWorldSpace ) . GetComponent < T > ( ) ;
83
56
0 commit comments