예제 #1
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";
            }
        }
    }
예제 #2
0
 public void addMotion(BvhData _bvh)
 {
     motion.Add(_bvh.motion[0]);
 }