void Start() { Point_struct point1 = new Point_struct(1, 1); Point_struct point2 = point1; Debug.Log(point1.GetPoint()); Debug.Log(point2.GetPoint()); }
//Assigning two intrinsic value types results in two independent variables on the stack static void Assign_ValueType() { Console.WriteLine("Assign, value type\n"); Point_struct p1 = new Point_struct(10, 10); Point_struct p2 = p1; //Points display p1.Disp_struct(); p2.Disp_struct(); //Changing p1.x = 50; Console.WriteLine("\n=> to p1.x\n"); p1.Disp_struct(); p2.Disp_struct(); }
void Start() { Point_struct point = new Point_struct(1, 1); Debug.Log(point.GetPoint()); }