示例#1
0
    void Start()
    {
        //JTestClass jtestClass = new JTestClass(true);

        //string jsonData = ObjectToJson(jtestClass);

        string dataPath = Application.dataPath + "/Data";

        //CreateJsonFile(dataPath, "JsonTestFile", jsonData);

        //var jtc2 = LoadJsonFile<JTestClass>(Application.dataPath, "JTestClass");
        //jtc2.Print();

        UpperBody idleState = new UpperBody("Idle", new List <string>()
        {
            "0.0", "0.0"
        });
        UpperBody attackState = new UpperBody("Attack", new List <string>()
        {
            "1.0", "1.0"
        });

        string jsonData = ObjectToJson(idleState);

        CreateJsonFile(dataPath, "IdleState", jsonData);

        var idleDataTest = LoadJsonFile <UpperBody>(dataPath, "IdleState");

        idleDataTest.Print();

        //UpperAndLowerBody upperAndLowerBody = LoadJsonFile<UpperAndLowerBody>(Application.dataPath + "/Data", "UpperBodyDatas");
        //upperAndLowerBody.Print();
    }
 public static void Init()
 {
     upperBody = new UpperBody(motorIds);
     SetSpeedAll(30);
     ResetAll();
 }