using System.Collections; using System.Collections.Generic; using UnityEngine; public class textwww : MonoBehaviour { // Start is called before the first frame update void Start() { StartCoroutine(TestLink("http://124.222.76.196:6789/NewFK/config/init2_1_2.json")); } // Update is called once per frame void Update() { } IEnumerator TestLink(string url) { WWW www = new WWW(url); yield return www; if (string.IsNullOrEmpty(www.error)) { Debug.Log("链接可访问: " + url); } else { Debug.LogError("访问失败: " + www.error); } } }