@@ -80,6 +80,26 @@ public static T Spawn<T>(T prefab, Transform parent, Vector3 position, Quaternio
8080 {
8181 return Spawn ( prefab . gameObject , parent , position , rotation ) . GetComponent < T > ( ) ;
8282 }
83+ public static T Spawn < T > ( T prefab , Vector3 position , Quaternion rotation ) where T : Component
84+ {
85+ return Spawn ( prefab . gameObject , null , position , rotation ) . GetComponent < T > ( ) ;
86+ }
87+ public static T Spawn < T > ( T prefab , Transform parent , Vector3 position ) where T : Component
88+ {
89+ return Spawn ( prefab . gameObject , parent , position , Quaternion . identity ) . GetComponent < T > ( ) ;
90+ }
91+ public static T Spawn < T > ( T prefab , Vector3 position ) where T : Component
92+ {
93+ return Spawn ( prefab . gameObject , null , position , Quaternion . identity ) . GetComponent < T > ( ) ;
94+ }
95+ public static T Spawn < T > ( T prefab , Transform parent ) where T : Component
96+ {
97+ return Spawn ( prefab . gameObject , parent , Vector3 . zero , Quaternion . identity ) . GetComponent < T > ( ) ;
98+ }
99+ public static T Spawn < T > ( T prefab ) where T : Component
100+ {
101+ return Spawn ( prefab . gameObject , null , Vector3 . zero , Quaternion . identity ) . GetComponent < T > ( ) ;
102+ }
83103 public static GameObject Spawn ( GameObject prefab , Transform parent , Vector3 position , Quaternion rotation )
84104 {
85105 List < GameObject > list ;
@@ -124,6 +144,26 @@ public static GameObject Spawn(GameObject prefab, Transform parent, Vector3 posi
124144 return obj ;
125145 }
126146 }
147+ public static GameObject Spawn ( GameObject prefab , Transform parent , Vector3 position )
148+ {
149+ return Spawn ( prefab , parent , position , Quaternion . identity ) ;
150+ }
151+ public static GameObject Spawn ( GameObject prefab , Vector3 position , Quaternion rotation )
152+ {
153+ return Spawn ( prefab , null , position , rotation ) ;
154+ }
155+ public static GameObject Spawn ( GameObject prefab , Transform parent )
156+ {
157+ return Spawn ( prefab , parent , Vector3 . zero , Quaternion . identity ) ;
158+ }
159+ public static GameObject Spawn ( GameObject prefab , Vector3 position )
160+ {
161+ return Spawn ( prefab , null , position , Quaternion . identity ) ;
162+ }
163+ public static GameObject Spawn ( GameObject prefab )
164+ {
165+ return Spawn ( prefab , null , Vector3 . zero , Quaternion . identity ) ;
166+ }
127167
128168 public static void Recycle < T > ( T obj ) where T : Component
129169 {
0 commit comments