Unity3d reference types in the scripting language

Source: Internet
Author: User

As mentioned in the previous text, the value type and the reference type, then this will be a separate reference type;

The C # language in Unity3d provides a special type to provide developers with the convenience of developing games using C #;

In this engine, you use the Unityengine namespace to put your own defined type in place. Among them, the Unityengine.object class is the most basic class in the C # scripting language of the game engine, which is the base class for all objects. All exposed variables derived from this class are displayed in the Monitor (Inspector) view.

Class members provided by this class:

field hideflags identifies whether the object is hidden [the 2017 version I used, all returned is none]
fields name name of Object
Public method  getinstanceid   Return instance ID for this object
Public method  tostring   Return the object name
static method  destroy   Destroy a Game object, component, or resource
static method  destroyimmediate   Destroy a Game object, component, or resource (destroyed immediately, but not recommended)
static method  dontdestroyonload   Ensure that the target object is not destroyed when switching scenes
static method  findobjectoftype   Returns the first activated target type Object
static method   findobjectsoftype   Returns a sequence that includes all active target pairs
static method  instantiate   Copy original object
     

Note: unity2017 version, determine whether the object is activated in the scene, I use the API is sth.activeself; "The return value is False, or true"

Unityengine.component class

In addition to the most basic unityengine.object, this class is also important, which derives from Unityengine.object and introduces new members in addition to the members that inherit from Unityengine.object.

See the next article ....

Unity3d reference types in the scripting language

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.