AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
UsabilityScaler.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
7 {
11  public class UsabilityScaler : MonoBehaviour
12  {
13  private Vector3 baseScale;
14 
15  private void OnEnable()
16  {
17  baseScale = transform.localScale;
18  float usabilityScaleFactor = UsabilityUtilities.GetUsabilityScaleFactor(Camera.main);
19 
20  transform.localScale = (baseScale * usabilityScaleFactor);
21  }
22 
23  private void OnDisable()
24  {
25  transform.localScale = baseScale;
26  }
27  }
28 }
static float GetUsabilityScaleFactor(Camera camera)
Gets a factor useful for scaling visual and interactable objects based on a camera's characteristics ...
A MonoBehaviour which automatically scales an object for better usability across different devices...
A helper class for making applications more usable across different devices.