AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
CycleDots.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 CycleDots : CycleArray<GameObject>
14  {
15  public override void SetIndex(int index)
16  {
17  base.SetIndex(index);
18 
19  for(int i = 0; i < Array.Length; ++i)
20  {
21  CycleColors colors = Array[i].GetComponent<CycleColors>();
22  CycleUniformScale scale = Array[i].GetComponent<CycleUniformScale>();
23 
24  if (colors != null)
25  {
26  colors.SetIndex(index == i ? 1 : 0);
27  }
28 
29  if (scale != null)
30  {
31  scale.SetIndex(index == i ? 1 : 0);
32  }
33  }
34  }
35  }
36 }
CycleArray is a class for incrementing through component properties sequentially or assigning specifi...
Definition: CycleArray.cs:15
Cycles through gameObjects to update the ColorColors and CycleScale on each dot according to the sele...
Definition: CycleDots.cs:13
override void SetIndex(int index)
Assign a specific element from the array. Place your custom logic to assign an element to TargetObjec...
Definition: CycleDots.cs:15
override void SetIndex(int index)
Select the color from the Array and apply it.
Definition: CycleColors.cs:35
Cycle through a list of colors and apply the current color to the material Supports ColorTransition f...
Definition: CycleColors.cs:14
Uniformly scales an object using a float based on the selected value from the array Supports ScaleToV...