AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
ButtonIconProfile.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.Generic;
5 using UnityEngine;
6 
7 namespace HoloToolkit.Unity.Buttons
8 {
12  public abstract class ButtonIconProfile : ButtonProfile
13  {
14  [Header("Defaults")]
18  public Texture2D _IconNotFound;
19 
23  public float AlphaTransitionSpeed = 0.25f;
24 
28  public Material IconMaterial;
29 
33  public Mesh IconMesh;
34 
39  public string AlphaColorProperty = "_Color";
40 
45  public virtual List<string> GetIconKeys()
46  {
47  return null;
48  }
49 
60  public virtual bool GetIcon(string iconName, MeshRenderer targetRenderer, MeshFilter targetMesh, bool useDefaultIfNotFound)
61  {
62  return false;
63  }
64 
65  #if UNITY_EDITOR
66  public virtual string DrawIconSelectField (string iconName)
67  {
68  iconName = UnityEditor.EditorGUILayout.TextField("Icon name", iconName);
69  return iconName;
70  }
71  #endif
72  }
73 }
virtual List< string > GetIconKeys()
Gets a list of icon names - used primarily by editor scripts
Mesh IconMesh
The default mesh used for icons
Material IconMaterial
The default material used for icons
The base class for button icon profiles
The base class for all button profiles Inherit from this to create new button profile types ...
Texture2D _IconNotFound
The icon returned when a requested icon is not found
virtual bool GetIcon(string iconName, MeshRenderer targetRenderer, MeshFilter targetMesh, bool useDefaultIfNotFound)
Searches for an icon If found, the icon texture is applied to the target renderer&#39;s material and the ...