Created
April 7, 2015 13:49
-
-
Save hirojun5670/d7f04c6c381162da3de6 to your computer and use it in GitHub Desktop.
UnityでWWW
This file contains 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; | |
using System.Collections; | |
public class WebRequestAPI : MonoBehaviour { | |
// Use this for initialization | |
void Start () { | |
StartCoroutine (Request("https://www.google.co.jp", ResponceAction)); | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
private IEnumerator Request(string url, Action<WWW> action){ | |
WWW www = new WWW (url); | |
yield return www; | |
action (www); | |
} | |
private void ResponceAction(WWW www){ | |
Debug.Log (www.text); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment