Unity Object class

Source: Internet
Author: User
Tags instance method unique id

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.