AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
ToolTipBackground.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 using HoloToolkit.Unity;
6 
7 namespace HoloToolkit.UX.ToolTips
8 {
9  [RequireComponent(typeof(MeshFilter))]
10 
16  public abstract class ToolTipBackground : MonoBehaviour
17  {
18  [SerializeField]
19  protected ToolTip toolTip;
20 
21  protected virtual void OnEnable()
22  {
23  toolTip = gameObject.EnsureComponent<ToolTip>();
24 
25  if (toolTip == null)
26  {
27  Debug.LogError("No tooltip found in ToolTipMeshBackground");
28  enabled = false;
29  return;
30  }
31 
32  toolTip.ContentChange += ContentChange;
33  }
34 
35  protected virtual void ContentChange()
36  {
37  ScaleToFitContent();
38  }
39 
40  protected abstract void ScaleToFitContent();
41  }
42 }
Class for Tooltip object Creates a floating tooltip that is attached to an object and moves to stay i...
Definition: ToolTip.cs:18
Base class for a tool tip background Automatically finds a ToolTip and subscribes to ContentChange ac...
Action ContentChange
Used for Content Change update in text
Definition: ToolTip.cs:405