1. Awake () Start () Update () fixedupdate ()
Unity is single-threaded, and for unity background scripts, the awake, Update, Lateupdate, and fixedupdate of each scripthave a block in the background. put each
Awake in the background ()
{
Awake () in script 0;
Awake () in script 1;
Awake () in script 2;
}
Backstage methods Awake, update, Lateupdate, Fixedupdate, and so on are in order, and so on all sub-scripts in the awake after the execution of the Start, update, Lateupdate and so on. So here's an explanation of unity's lack of multi-threading concepts.
Update in the background ()
{
Update () in script 0;
Update () in script 1;
Update () in script 2;
}
The awake function is executed before the script is enabled, and start is not executed until the script is enabled. Generally speaking, the variable refers to the script, and so on, in awake. The first action on the object can be placed in start
2. Vectors
In two-and three-dimensional coordinate systems, vectors can be labeled in positions with both direction and length. Speed is directional, and velocity has no direction, so vectors can also represent speed. A position vector Vector3 (5,6,0), a velocity vector Vector3 (4,6,0), that represents moving in the x direction every hour 4, 6 in the Y direction. Then the current position vector Vector3 (5,6,0) + speed vector Vector3 (4,6,0) is the position of the object one hour after Vector3 (9,12,0).
3. Linear interpolation
A linear interpolation between two values is useful in developing some games. Unity can use LERP () to implement interpolation functions. Linear interpolation calculates the value of a scale between two values. Between 3,5, the linear difference of 50% is equal to 4. Unity has several different types of lerp () functions. Like what
4. Displacement Rotation Translate () Rotate ()
5.LookAt ()
6. Deltatime
7.Destroy ()
8.Input class Getbutton () GetKey () Getaxis () OnMouseDown ()
9.Invoke ()
10.Invoke ()
Unity Learning Notes-Common scripting functions