"Unity3d scripting uses C # language to develop Cross-platform games" Reading notes 2__ programming

Source: Internet
Author: User

3.3 Reference types

Unityengine.object class

Unityengine.component class

Because the build itself cannot be attached directly to the game object, the component can only be coded by script, in effect adding the script of the corresponding component to the game object.

A generic version of the Getcomponents method is often recommended from a performance standpoint. A method like getcomponents is best to save a reference to a target object on the first call, rather than calling the method repeatedly to get a reference to the target object.


Unityengine.monobehaviour class

The Monobehaviour class inherits from the Unityengine.behaviour class.

The Monobehaviour class is the base class for all Unity3d scripts. When you want to use the C # language to complete a new script, you must explicitly inherit the Monobehaviour class (that is, the type declared in the new script must be specified to inherit from the Monobehaviour Class).

Any type that inherits from the Monobehaviour class or the Monobehaviour class itself cannot be instantiated with the new keyword.

You need to create an object that inherits the type of the Monobehaviour class, P81


The characteristics and execution order of event functions P81-p90


3.4.1 Vector2 Vector3 Vector4

Point Multiply fork Multiply p92-p94


3.5 Box and unboxing P95


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.