Hi,
I searched but couldn’t find any details on how exactly Instantiate()
clones an object, specifically when that object has scripts attached to it, and those script have class variables.
So for example:
class test1 : MonoBehaviour {
public int num;
public List<int> multiNum;
public MyClass myObj;
}
now, if I instantiate an object with test1 script attached to it, will it clone the value of num
variable? What about multiNum
variable? And last, what about myObj
which is a class that I created. Will it clone it? If yes, then how does it clone it?
Thanks