AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
CycleTextMeshColors.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 System.Collections;
5 using System.Collections.Generic;
6 using UnityEngine;
7 
8 namespace HoloToolkit.Examples.Prototyping
9 {
13  public class CycleTextMeshColors : CycleArray<Color>
14  {
15  [Tooltip("TextMesh to assign the selected text")]
16  public TextMesh TextMeshObject;
17 
18  protected override void Awake()
19  {
20  if (TextMeshObject == null)
21  {
22  TextMeshObject = GetComponent<TextMesh>();
23  }
24 
25  base.Awake();
26  }
27 
32  public override void SetIndex(int index)
33  {
34  base.SetIndex(index);
35 
36  if (TextMeshObject == null)
37  {
38  TextMeshObject = GetComponent<TextMesh>();
39  }
40 
41  TextMeshObject.color = Array[Index];
42  }
43  }
44 }
CycleArray is a class for incrementing through component properties sequentially or assigning specifi...
Definition: CycleArray.cs:15
override void Awake()
set the default TargetObject
override void SetIndex(int index)
apply the selected text
Sets the color of a TextMesh object based on the selected value in the array