rayfigs
New Member
Posts: 9
Posts: 9
|
Post by rayfigs on May 5, 2015 6:47:21 GMT
Hi, I'm trying to use pool boss to spawn items but I am getting the following error:
This is the line that is generating the error:
GameObject coinObject = DarkTonic.CoreGameKit.PoolBoss.Spawn(name,PrizeGeneratePoint.position,PrizeGeneratePoint.rotation);
In the docs it looks like this method takes 3 arguments with a 4th being optional. Am I over looking something here?
Many thanks, Reinaldo
|
|
|
Post by DarkTonic Dev on May 5, 2015 15:29:37 GMT
|
|
rayfigs
New Member
Posts: 9
Posts: 9
|
Post by rayfigs on May 5, 2015 18:58:35 GMT
|
|
rayfigs
New Member
Posts: 9
Posts: 9
|
Post by rayfigs on May 5, 2015 19:54:24 GMT
Looking at the doc. I don't understand how pool boss would know what needs to spawn. two transforms are passed to it as well as the position and rotation of the object. I would imagine that the I would reference the prefabs that I dragged into poolboss' inspector window. Is it possible to explain how explain how poolboss is able to manage to know what item to spawn if I'm passing it a transform of the object? Also what does the parent transform need to be if I expect the object to be parented to poolboss object?
Many thanks, Reinaldo
|
|
|
Post by DarkTonic Dev on May 5, 2015 20:10:30 GMT
Ok that part is out of date. It's not optional. You can pass in null if you want no parent or use SpawnInPool or SpawnOutsidePool. SpawnInPool keeps the spawned object under Pool boss.
Pool boss knows what to spawn because its the first parameter you pass in to Spawn. It matches by name.
|
|
|
Post by DarkTonic Dev on May 6, 2015 2:55:27 GMT
The API website has been updated for accuracy.
|
|
rayfigs
New Member
Posts: 9
Posts: 9
|
Post by rayfigs on May 6, 2015 16:25:03 GMT
Looking at the sample code in KW_Player.cs I can see that SpawnOutsidePool was used by referencing a ProjectilePrefab which is a public GameObject that was passed to it via the inspector.
PoolBoss.SpawnOutsidePool(ProjectilePrefab.transform, spawnPos, ProjectilePrefab.transform.rotation);
Since I assigned the prefabs in advanced to pool boss, is there a way to reference the prefabs that I want to spawn by the prefab name?
|
|
|
Post by DarkTonic Dev on May 6, 2015 17:22:21 GMT
You can also spawn an item by name (string). There are 2 different versions of each Spawn method. You might have missed this?
|
|
rayfigs
New Member
Posts: 9
Posts: 9
|
Post by rayfigs on May 6, 2015 18:23:20 GMT
Actually I did notice that, I was just very confused by it. Thanks, your feedback is very much appreciated.
|
|
|
Post by DarkTonic Dev on May 6, 2015 18:50:17 GMT
Ok. If you have suggestions to make the API website more clear, let me know.
|
|