Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created February 12, 2017 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushpot1125/064c05a6e436eda532ac99ef4a5346a9 to your computer and use it in GitHub Desktop.
Save flushpot1125/064c05a6e436eda532ac99ef4a5346a9 to your computer and use it in GitHub Desktop.
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