Working with quaternions
In Unity, the rotation of a transform is stored internally as a quaternion, which has four componenets, namely x, y, z, and w. However, these four components do not represent angles or axes, and we developers usually do not need to access them directly. You may be confused because if you look at the Inspector window of a transform, you will find the rotation is displayed as a Vector3.
This is because although Unity uses quaternions to store rotations internally, in addition to quaternions, rotations can also be represented by three angle values of x, y, and z, namely Euler angles.
Therefore, for the convenience of developers to edit, Unity displays the value of the equivalent Euler angle in the Inspector.
So, why doesn't Unity use Euler angles to store rotations directly? It is composed of three axes angles and is in a format that is easy for humans to read....