Created
February 12, 2017 15:12
-
-
Save flushpot1125/064c05a6e436eda532ac99ef4a5346a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Update() | |
{ | |
PerformRotation(); | |
} | |
private void PerformRotation() | |
{ | |
if (GestureManager.Instance.IsNavigating && | |
(!ExpandModel.Instance.IsModelExpanded || | |
(ExpandModel.Instance.IsModelExpanded && HandsManager.Instance.FocusedGameObject == gameObject))) | |
{ | |
/* TODO: DEVELOPER CODING EXERCISE 2.c */ | |
// 2.c: Calculate rotationFactor based on GestureManager's NavigationPosition.X and multiply by RotationSensitivity. | |
// This will help control the amount of rotation. | |
rotationFactor = GestureManager.Instance.NavigationPosition.x * RotationSensitivity; | |
// 2.c: transform.Rotate along the Y axis using rotationFactor. | |
transform.Rotate(new Vector3(0, -1 * rotationFactor, 0)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment