一、对于引用类型你了解多少?
string a = "1"; string b = a; a = "2"; print(b); GameObject a = new GameObject("1");//game object 有一个 name 构造 GameObject b = a; a.name = "2"; print(b.name); Vector2 a = new Vector2(1, 1); Vector2 b = a; a.x = 2; print(b.x); GameObject a = new GameObject("1"); GameObject b = a; a = new GameObject("2"); print(b.name);
时间: 2024-11-05 20:45:32