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
- Gameobject.addcomponent<particlesystem> (); //Add a particle system to the current object
- Particlesystem PS = gameobject.getcomponent<particlesystem> (); //query to this particle system
- Destroy (PS); //Remove the particle system
Go.transform.Translate (vector3.forward*time.deltatime*speed);//go This object moves along the z axis
Unity C #