- Home /
Use via Inspector to script assigned public texture as default
Hey,
I have a script with a public Texture2D to which I assigned a Texture via Inspector directly on the script (not assigned to a gameobject yet).
I thought, that this could be used as default value, e.g. if I now drag and drop this script onto a gameobject, it will fill it automatically with the assigned Texture, or at least if I use AddComponent via script, the to the script assigned texture should be used. But instead the Texture is always null.
What is the use of assigning public members directly to the script? Is there a way of assigning such a default value for a public member?
thx.
Your answer
Follow this Question
Related Questions
Is there a way to add another slot for a script in the Inspector? 1 Answer
Giving a public Transform field a default value in the inspector 1 Answer
Default Serialization Values Not Being Set 0 Answers
Do something when something happens in another script. 3 Answers
Change the default script template? 5 Answers