Exemple #1
0
    // Handling custom gesture adding callback - This is invoked when the Mode is set to Mode.AddPlayerGesture and a gesture is
    // recorded. Gestures are only added to a cache. You should call SetCustomGesture() to actually set gestures to database.
    // gestureId - a serial number
    // result - return a map of all un-set custom gestures and number of gesture collected.
    void HandleOnPlayerGestureAdd(long gestureId, Dictionary <int, int> result)
    {
        int count = result [currentPlayerGestureStep];

        textToUpdate = string.Format("{0}{1}/{2} gesture(s) collected for {3}\nContinue to collect more samples</color>",
                                     currentPlayerGestureStep == PLAYER_GESTURE_ONE ? "<color=#FF00FF>" : "<color=yellow>",
                                     count, MAX_TRAIN_COUNT,
                                     currentPlayerGestureStep == PLAYER_GESTURE_ONE ? "GESTURE #1" : "GESTURE #2");
        if (count >= MAX_TRAIN_COUNT)
        {
            currentPlayerGestureStep++;
            nextUiAction = () => {
                StopCoroutine(uiFeedback);
                textResult.text = defaultResultText = "Think of a gesture\nWrite it 5 times~\n<color=yellow>GESTURE #2</color>";
            };
        }

        if (currentPlayerGestureStep > PLAYER_GESTURE_TWO)
        {
            nextUiAction = () => {
                NextMode();
            };
        }
        else
        {
            airsigManager.SetTarget(new List <int> {
                currentPlayerGestureStep
            });
        }
    }
Exemple #2
0
    void AddGesture()
    {
        m_currentGestureID++;
        m_allGestureIDs.Add(m_currentGestureID);

        m_airsigManager.SetMode(AirSigManager.Mode.AddPlayerGesture);
        m_airsigManager.SetTarget(new List <int> {
            m_currentGestureID
        });
    }