Skip to content

Instantly share code, notes, and snippets.

@kihira
Last active April 2, 2016 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kihira/26366fd94f26c7bb0868cd199c1bdbac to your computer and use it in GitHub Desktop.
Save kihira/26366fd94f26c7bb0868cd199c1bdbac to your computer and use it in GitHub Desktop.
[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