Hi,
I have a script component which has a public field with reference type(e.g. class), and the value of this field is null by default. I found that if I select a object with this component in the editor thus making its content visible in the Inspector, the Inspector automatically fills the public field with a instance of the type of the field, and this instance seems created using its default constructor.
I also tried not to select the object and print out the value of this field, then it was kept null as I expected.
I think it is strange and would like to know is this the default behavior of the Inspector?
Thanks.
Oh, yes, I did make the type of that field Serializable. Thanks for answering, it really helps.
– sedlu