Create a gist now

Instantly share code, notes, and snippets.

@kihira /HandInfoPanel.cs Secret
Last active Apr 2, 2016

What would you like to do?
[Header("UI")]
[SerializeField] private GameObject canvas;
private WallInteractable.LogData currLog;
private float playingTime = 0f;
public void Attach(HandModel handModel, WallInteractable.LogData log)
{
hand = handModel;
detachedTime = 0f;
currLog = log;
playingTime = 0f;
// TODO show downloading message
canvas.SetActive(true);
GameObject.Find("Canvas/Text Panel/ScrollView/Text").GetComponent<Text>().text = log.message;
GameObject.Find("Canvas/Text Panel/ScrollHandle").GetComponent<DynamicScroll>().DelayedUpdate(0.1f);
GetComponent<AudioSource>().clip = log.audio;
if (log.autoPlay) GetComponent<AudioSource>().Play();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment