Exemplo n.º 1
0
    public static void trainingUpdateCallback(double performance, IntPtr ptr)
    {
        // Get the script/scene object back from metadata.
        GCHandle         obj = (GCHandle)ptr;
        Sample_TwoHanded me  = (obj.Target as Sample_TwoHanded);

        // Update the performance indicator with the latest estimate.
        me.last_performance_report = performance;
    }
Exemplo n.º 2
0
    public static void trainingFinishCallback(double performance, IntPtr ptr)
    {
        // Get the script/scene object back from metadata.
        GCHandle         obj = (GCHandle)ptr;
        Sample_TwoHanded me  = (obj.Target as Sample_TwoHanded);

        // Update the performance indicator with the latest estimate.
        me.last_performance_report = performance;
        // Signal that training was finished.
        me.recording_gesture = -3;
    }
Exemplo n.º 3
0
    // Callback function to be called by the gesture recognition plug-in when the learning process was finished.
    public static void trainingFinishCallback(double performance, IntPtr ptr)
    {
        // Get the script/scene object back from metadata.
        GCHandle         obj = (GCHandle)ptr;
        Sample_TwoHanded me  = (obj.Target as Sample_TwoHanded);

        // Save the data to file.
#if UNITY_EDITOR
        string gesture_file_path = "Assets/GestureRecognition";
#else
        string gesture_file_path = Application.streamingAssetsPath;
#endif
        if (me.SaveGesturesFile == null)
        {
            me.SaveGesturesFile = "Sample_TwoHanded_MyRecordedGestures.dat";
        }
        me.gc.saveToFile(gesture_file_path + "/" + me.SaveGesturesFile);
        // Update the performance indicator with the latest estimate.
        me.last_performance_report = performance;
        // Signal that training was finished.
        me.recording_gesture = -3;
    }