AvatarController.GetInitialRotations C# (CSharp) Method

GetInitialRotations() public method

public GetInitialRotations ( ) : void
return void
    void GetInitialRotations()
    {
        if(offsetNode != null)
        {
            // Store the original offset's rotation.
            originalRotation = offsetNode.transform.rotation;
            // Set the offset's rotation to 0.
            offsetNode.transform.rotation = Quaternion.Euler(Vector3.zero);
        }

        for (int i = 0; i < bones.Length; i++)
        {
            if (bones[i] != null)
            {
                initialRotations[i] = bones[i].rotation;
            }
        }

        if(offsetNode != null)
        {
            // Restore the offset's rotation
            offsetNode.transform.rotation = originalRotation;
        }
    }