soundvision/UnityProject/Assets/Scenes/Examples/TimbreID/script/idtotext.cs
2019-10-29 15:42:02 +01:00

25 lines
522 B
C#

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;
}
}
}