Unity C #

Source: Internet
Author: User

Gameobject//Gets the game object that the current script is attached to

In unity, even if you use C # for scripting, you cannot use the console class for output, you should use print (), or Debug.log ();

Transform represents the transform component on the game object that the script is mounted on

Transform.position//Get various properties of Transform, other properties of other components similarly

Getcomponent<> ();//Use generic methods to get component objects of the specified type on the current game object

Addcomponent<> (); Add a specified component to the current game object

    1. Gameobject.addcomponent<particlesystem> (); //Add a particle system to the current object
    2. Particlesystem PS = gameobject.getcomponent<particlesystem> (); //query to this particle system
    3. Destroy (PS); //Remove the particle system

Go.transform.Translate (vector3.forward*time.deltatime*speed);//go This object moves along the z axis

Unity C #

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.