soundvision/UnityProject/Assets/Scenes/Examples/TimbreID/script/idtotext.cs

26 lines
522 B
C#
Raw Normal View History

2019-10-29 14:42:02 +00:00
using UnityEngine;
using UnityEngine.UI;
public class IdToText : MonoBehaviour
{
[SerializeField] private Text text;
public void OnTimbreIdReceived(int id, int distance)
{
switch (id)
{
case 0:
text.text = "Snare";
break;
case 1:
text.text = "Hi-hat";
break;
case 2:
text.text = "Kick";
break;
default:
return;
}
}
}