Answers for "invalidcastexception: specified cast is not valid. unity"

0

invalidcastexception: specified cast is not valid. unity

car = JsonUtility.FromJson<Car>(json);
Posted by: Guest on October-08-2021
0

invalidcastexception: specified cast is not valid. unity

// Here the Car reference returned by FromJson is BOXED into object
System.Object @object = JsonUtility.FromJson<Car>(json);
// Since @object is still a boxed Car value it is now UNBOXED from object to Car
car = (Car)@object;
Posted by: Guest on October-08-2021

Code answers related to "invalidcastexception: specified cast is not valid. unity"

Browse Popular Code Answers by Language