Created
May 27, 2014 11:37
-
-
Save kyubuns/2ac7d81ac093caac77b5 to your computer and use it in GitHub Desktop.
TestButton
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class TestButton : MonoBehaviour { | |
[SerializeField] string imageUrl; | |
UITexture texture; | |
void Awake() | |
{ | |
texture = GetComponent<UITexture>(); | |
} | |
IEnumerator Start() | |
{ | |
WWW www = new WWW(imageUrl); | |
yield return www; | |
texture.mainTexture = www.texture; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment