juntaou
New Member
Posts: 10
Posts: 10
|
Post by juntaou on Apr 24, 2014 19:59:39 GMT
So I'm currently extending the killable script and am trying to just make a variable visible to the inspector so I can assign it there. However when I make the variable in script nothing becomes visible in the inspector. I'm sure this is some obvious noob issue that I'm missing... But what am I missing?
public GameObject otherGameObject;
Usually that makes it visible to the editor for me, but currently it is not. Any help would be appreciated.
Thanks!
|
|
juntaou
New Member
Posts: 10
Posts: 10
|
Post by juntaou on Apr 24, 2014 20:09:45 GMT
Nevermind I think I got it, I have to edit the KillableInspector class.
|
|
DarkTonic Dev
Administrator
Posts: 4,341
Posts: 4,341
Member is Online
|
Post by DarkTonic Dev on Apr 24, 2014 20:51:01 GMT
Correct. But the next time you upgrade the plugin, your changes will be overwritten. Describe what you're trying to do and I'll see if there's a better way or if there's something we should add.
|
|
juntaou
New Member
Posts: 10
Posts: 10
|
Post by juntaou on Apr 24, 2014 21:16:35 GMT
So I have a certain attack that does chain damage. It does so by spawning a sphere collider and checking the tags of everything hit. So I need a way to spawn that gameobject when the enemy gets hit by that certain attack or gets hit by another of the previously spawned gameobjects. Thus creating a chainreaction amongst the enemies. But I have a lot of different skills and what the enemy spawns on hit should be determined by what they are hit with. If that makes sense. So I guess the way it would need to be able to be handled would be for my to be able to choose different things to spawn depending on how they are damaged. I don't know if thats possible as is right now.
|
|
DarkTonic Dev
Administrator
Posts: 4,341
Posts: 4,341
Member is Online
|
Post by DarkTonic Dev on Apr 24, 2014 21:26:21 GMT
Probably instead of adding things directly to Killable, you should make a subclass of Killable. Then you can override key methods and leave the rest. This would not be overridden by CGK updates. Then if you need, you can make a custom inspector of your subclass type, starting with the Killable Inspector as a base.
|
|
juntaou
New Member
Posts: 10
Posts: 10
|
Post by juntaou on Apr 25, 2014 15:11:13 GMT
Yeah thats probably the best way to handle it, I'll give it a shot and let you know how it goes.
|
|
DarkTonic Dev
Administrator
Posts: 4,341
Posts: 4,341
Member is Online
|
Post by DarkTonic Dev on Apr 25, 2014 15:53:51 GMT
Sounds good!
|
|
juntaou
New Member
Posts: 10
Posts: 10
|
Post by juntaou on Apr 26, 2014 0:04:12 GMT
So revisiting this question, but its more of a follow up question.
So let's say that I want to use a spawner to spawn all of those damage prefabs I was talking about for the spell that chains attacks through nearby similar units. I attached the TimeDespawn script to it so it kills itself off after .1 seconds. However what is the best way to handle spawning all of those prefabs. There are 5 different prefabs(The prefabs of the spell that I'm referring to are actually just colliders marked as triggers to check for proximity collisions of the spell) of this same type based on which unit was hit. So for example right now lets say there are 5 basic units. Each is a different color. When they get hit with the chain spell that matches their color they themselves should spawn the spell prefab of that color so the attack will chain through all nearby units of that color. Ideally I would actually pre spawn and then despawn like 20 of each color so if there is ever a big chain there would be no slowdown actually spawning new ones. So the question then is what is the best way to handle that? Do I need to have 1 spawner for each of the different color prefabs, Or is there a way to have 1 spawner that can handle all of the different colors even though they have to spawn a specific prefab depending on what color gets hit? Let me know if that question doesn't make sense. Thanks!
|
|
DarkTonic Dev
Administrator
Posts: 4,341
Posts: 4,341
Member is Online
|
Post by DarkTonic Dev on Apr 26, 2014 0:42:12 GMT
I would have 1 prefab (Triggered Spawner) for each color you need to spawn, then you can use the tag filters to only spawn a wave (even if it's just one item) when the correct color spell hits it (make sure you make tags for each color). Yes, prespawn all prefabs of all types by setting them up in Pool Boss.
Because you want logic to determine what you're spawning, this is the best way, without having to write any code.
|
|