AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
RotateMinMax.cs
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License. See LICENSE in the project root for license information.
3 
4 using UnityEngine;
5 
6 namespace HoloToolkit.Unity.Tests
7 {
8  public class RotateMinMax : MonoBehaviour
9  {
10  [SerializeField] private float _minAngle = 0;
11  [SerializeField] private float _maxAngle = 0;
12  [SerializeField] private float _step = 0;
13 
14  private void Update()
15  {
16  transform.Rotate(Vector3.up, _step);
17  if (transform.localRotation.eulerAngles.y < _minAngle || transform.localRotation.eulerAngles.y > _maxAngle)
18  {
19  _step *= -1;
20  }
21  }
22  }
23 }