Esempio n. 1
0
 public void LoadFile(string path)
 {
     //roots.Clear();
     BvhUtility.ParseBvhData(ref datas, path);
     CreateCubeObj();
     //string fileContent = File.ReadAllText(path);
 }
Esempio n. 2
0
    //error return 1
    public bool LoadFile(string path)
    {
        int error = BvhUtility.ParseBvhData(ref datas, path);

        if (error == 1)
        {
            datas.RemoveAt(datas.Count - 1);
            return(true);
        }
        CreateCubeObj();
        return(false);
    }
Esempio n. 3
0
    //public void LoadFileAM()
    //{
    //    List<BvhData> tmp = new List<BvhData>();
    //    int error = BvhUtility.ParseBvhData(ref tmp, Application.dataPath + "/Resources/" + FileName.text + ".bvh");
    //    if (error == 1)
    //        Log.text = "error";
    //    else if (BvhData.equal(GameManager.One.datas[GameManager.One.dataIndex].joint, tmp[0].joint))
    //    {
    //        GameManager.One.datas[GameManager.One.dataIndex].addMotion(tmp[0]);
    //    }
    //    else
    //        Log.text = "error";
    //}
    public void LoadFileAM()
    {
        OpenFileDialog dialog = new OpenFileDialog();

        if (dialog.ShowDialog() == DialogResult.OK)
        {
            List <BvhData> tmp   = new List <BvhData>();
            int            error = BvhUtility.ParseBvhData(ref tmp, dialog.FileName);
            if (error == 1)
            {
                Log.text = "error";
            }
            else if (BvhData.equal(GameManager.One.datas[GameManager.One.dataIndex].joint, tmp[0].joint))
            {
                GameManager.One.datas[GameManager.One.dataIndex].addMotion(tmp[0]);
            }
            else
            {
                Log.text = "error";
            }
        }
    }