IEnumerator enumerator(WWW www, Action_1_param <WWW> action) { Debug.Log(" 向外发出请求: url=" + www.url); yield return(www); action(www); if (www.error != null) { Debug.Log(" png图片加载失败!error:" + www.error + " url:" + www.url); } }
public static void FindKey(JsonData rootJsonData, string key, Action_1_param <JsonData> findKeyResult) { if (rootJsonData == null || key == null || findKeyResult == null) { throw new System.ArgumentNullException(); } if (!rootJsonData.IsObject) { throw new System.Exception("无效值,须为json对象!" + rootJsonData); } foreach (var k in rootJsonData.Keys) { if (k == key) { findKeyResult(rootJsonData[k.ToString()]); return; } } findKeyResult(null); }
public void StartWWW(WWW wWW, Action_1_param <WWW> wWWDelegate) { StartCoroutine(enumerator(wWW, wWWDelegate)); }