object is the base class for all objects in unity. So I think it's necessary to make a tidy.
First of all, Dontdestroyonload is the static method of the object class, the landlord in the previous blog has a detailed introduction. Just mention it here and don't do any introductions.
One, about the instance method:
①:getinstanceid, put back the ID number of the object
Definition: public int Getinstanceid ()
(Each gameobject, the component and its subclasses have a unique ID number, including the clone)
Second, about static methods:
①: Destroying Objects Destroy
Definition: public static void Destroy (Object obj)
public static void Destroy (Object obj, float t< sec >)
(Eliminate objects after t seconds, or destroy a component < except Transform >)
②: Findobjectsoftype: Get Object
Definition: public static t[] findobjectsoftype<t> () where t:object
public static object[] Findobjectsoftype (type type)
(similar to Findobjectoftype and Findobjectsoftype, used to return the first object in a project that conforms to type types)
③: Instantiate: Instantiating an object
Definition: public static object Instantiate (object original)
public static object Instantiate (object original, Vector3 position, quaternion rotation)
This article is from the "Better_power_wisdom" blog, make sure to keep this source http://aonaufly.blog.51cto.com/3554853/1871852
Unity Object class