Skip to content

Instantly share code, notes, and snippets.

@tsubaki tsubaki/DelegateSample.cs
Last active Dec 13, 2015

What would you like to do?
delegate void DownloadAction(WWW www);
public Texture mainTexture;
void Start()
StartCoroutine(DownloadAndAction(urls[0], SetMainTexture));
void SetMainTexture(WWW www )
mainTexture = www.texture;
IEnumerator DownloadAndAction(string url, DownloadAction act)
using( WWW www = new WWW(url))
while( !www.isDone && string.IsNullOrEmpty(www.error)) {
yield return null;
if( act!=null)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.