Change an object reference with script?
For example, I have a script which is a component of an object: http://imgur.com/lhMC8jq And after I click the small circle it open a window like this: http://imgur.com/eAPeSh9
So this window allows me to change the current prefab for the "Bomb" property right?
My question is, can we do this with script? (I mean with code). I notice that it shows a string path which leads to the prefab, can I somehow access to that path, and change it, or is there any other way to change the current prefab? Like I want to randomly choose a bomb from a set of bombs when the player hit the button. Thanks in advance.
Your answer
Follow this Question
Related Questions
Enable and disable of prefab components 1 Answer
How do I spawn prefab object with script attached to it? 1 Answer
ECS Entity not shown in the scene 1 Answer
Start moving unchecks itself 0 Answers