Multiply script of same type in single game object, how to choose in inspector
For example, I have GameObjectA with two component which both are type ScriptA. Then I have GameObjectB with a component of ScriptB. ScriptB have a field of type ScriptA. How can I choose which component in GameObjectA as parameter of ScriptB in GameObjectB.
How can I determine which ScriptA with value 1 or value 10 as the parameter in ScriptB?
I have try to find out this problem by myself but failed. Thanks very much for any help!!!
First out of curiosity why do you have 2 of the same script on 1 object? But the easiest way I could think of would be to have 2 sub objects under GameObjectA each one having 1 Script A with different values, and you would know which one you are dropping into GameObjectB.
Your answer
Follow this Question
Related Questions
Set a public Component variable in the Inspector 0 Answers
One specific script won't appear as a component in the Inspector only in Game Mode?? 0 Answers
Is there a way to refer to the only script the object has without naming the script? 2 Answers
Drop down menu for public variables on a component in the inspector. 0 Answers
How to custom inspector with dynamic options (e.g. Light Component) 1 Answer