2个问题。在unity3d中使用LitJson
1)是否有可能在Javascript脚本编写时使用LitJson库?这真的是一个关于能够在javascript源代码中使用c#源代码的常见问题。
2)我是新来的C#dev。我似乎无法让LitJson启动并运行。下面的代码引发此错误:An object reference is required to access non-static member
LitJson.JsonReader.Read()''
using UnityEngine;
using System.Collections;
public class Loadr : MonoBehaviour {
string url= "http://developer.echonest.com/api/v4/artist/images?api_key=N6E4NIOVYMTHNDM8J&id=ARH6W4X1187B99274F&format=json&results=1&start=0&license=unknown";
void Start(){
WWW www = new WWW(url);
print(www.text);
Object a = LitJson.JsonReader.Read(www.text);
print(a.response.status);
}
}
有什么想法?