コード例 #1
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        BVHRecorder bvhRecorder = (BVHRecorder)target;

        if (GUILayout.Button("Detect bones"))
        {
            bvhRecorder.getBones();
            Debug.Log("Bone detection done.");
        }

        if (GUILayout.Button("Remove empty entries from bone list"))
        {
            bvhRecorder.cleanupBones();
            Debug.Log("Cleaned up bones.");
        }

        if (GUILayout.Button("Clear recorded motion data"))
        {
            bvhRecorder.clearCapture();
            Debug.Log("Cleared motion data.");
        }

        if (GUILayout.Button("Save motion to BVH file"))
        {
            try {
                bvhRecorder.saveBVH();
            } catch (Exception ex) {
                Debug.LogError("An error has occurred while saving the BVH file: " + ex);
            }
        }
    }
コード例 #2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        BVHRecorder bvhRecorder = (BVHRecorder)target;

        if (GUILayout.Button("Detect bones"))
        {
            bvhRecorder.getBones();
            Debug.Log("Bone detection done.");
        }

        if (GUILayout.Button("Remove empty entries from bone list"))
        {
            bvhRecorder.cleanupBones();
            Debug.Log("Cleaned up bones.");
        }

        if (GUILayout.Button("Clear recorded motion data"))
        {
            bvhRecorder.clearCapture();
            Debug.Log("Cleared motion data.");
        }

        if (GUILayout.Button("Save motion to BVH file"))
        {
            try {
                bvhRecorder.saveBVH();
            } catch {
                Debug.LogError("Motion data can only be saved while the scene is running.");
            }
        }
    }