public static void Each(JsonData rootJsonData, Action_2_param <string, object> action_2_Param) { if (rootJsonData == null || action_2_Param == null) { throw new System.ArgumentNullException(); } if (!rootJsonData.IsObject && !rootJsonData.IsArray) { throw new System.Exception("无效值,须为json对象或json数组!" + rootJsonData); } if (rootJsonData.IsArray) { foreach (var key in rootJsonData) { action_2_Param(null, key); } } else { foreach (var key in rootJsonData.Keys) { action_2_Param(key, rootJsonData[key]); } } }
IEnumerator enumerator(WWW www, int index, Action_2_param <WWW, int> action) { yield return(www); action(www, index); if (www.error != null) { Debug.Log(" png图片加载失败!error:" + www.error + " url:" + www.url); } }
public void StartWWW(WWW wWW, int index, Action_2_param <WWW, int> wWWDelegate) { StartCoroutine(enumerator(wWW, index, wWWDelegate)); }