- Home /
Exposing a field based on a dropped prefab
Suppose you have a "missile" prefab in your project with a script which has a exposed public field, such as "speed". You also have a spacecraft prefab with several child transforms for storing where the missiles are spawned from when fired. On each of those child objects (call them "gun bays") you have an exposed GameObject field into which you drag the prefab you want to fire. But you don't want every gun bay to behave in the same way. Is it possible to have the Editor show the "speed" field from the missile gameObject when it's dropped into the gun bay transforms? Can this be done only with Editor property drawers or is there a simpler way? I can create different, exposed variables in the gun bay scripts and assign new values to missiles every time they're fired. That's not difficult. But I was wondering if there was a Unity-esque shortcut... Thanks.
Your answer
Follow this Question
Related Questions
Use Singleton Prefab in Button's onClick editor field 0 Answers
Prefab becoming distorted 0 Answers
Problem with prefabs, help? 0 Answers
Prefabs shown as blue boxes and not previews 0 Answers
Referencing a prefab in another prefab created programmatically 0 Answers