AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
CycleScale.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 System.Collections;
6 using HoloToolkit.Unity;
7 
8 namespace HoloToolkit.Examples.Prototyping
9 {
14  public class CycleScale : CycleArray<Vector3>
15  {
16  private ScaleToValue mScaler;
17 
18  protected override void Awake()
19  {
20  mScaler = GetComponent<ScaleToValue>();
21 
22  base.Awake();
23  }
24 
29  public override void SetIndex(int index)
30  {
31  base.SetIndex(index);
32 
33  Vector3 item = Current;
34 
35  if (mScaler != null)
36  {
37  mScaler.TargetValue = item;
38  mScaler.StartRunning();
39  }
40  else
41  {
42  TargetObject.transform.localScale = item;
43  }
44  }
45  }
46 }
CycleArray is a class for incrementing through component properties sequentially or assigning specifi...
Definition: CycleArray.cs:15
void StartRunning()
Start the animation
Definition: ScaleToValue.cs:66
Animates the scaling of an object with eases
Definition: ScaleToValue.cs:14
override void Awake()
set the default TargetObject
Definition: CycleScale.cs:18
override void SetIndex(int index)
Set the scale value or animate scale
Definition: CycleScale.cs:29
scales an object based on the selected value in the array Supports ScaleToValue for animation and eas...
Definition: CycleScale.cs:14