[Unity game development] commonly used class of Transform class

Transform Component Role: 
 Transform 1. Responsible game object (position, rotation, and scale) 

 2. maintain the parent-child relationship

Transform component is mainly Position, Rotation, and Scale corresponds to the position, rotation and scaling.

Common properties

 

Attributes Explanation
position The world coordinate system transform position
localPosition The position of the object relative to the parent
eulerAngles Euler angles, the angle of rotation
rotation Quaternion world coordinate system transformation
parent Transform component object of the parent object
root Transform objects highest level parent objects

Common method

void Translate(Vector3 translation) Makes the current object is located in translation
void Rotate(Vector3 eulerAngles) Given by the Euler angle rotation
void RotateAround(Vector3 point, Vector3 axis, float angle)  About a point of rotation angle points along the axis of the shaft
Transform Find(string name) Finding child objects by name
void LookAt(Transform target) An object toward the target point

Guess you like

Origin blog.csdn.net/Alina_catty/article/details/79377590