// Use this for initialization
    void Awake()
    {
        //Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);

        // Update the display text
        textResult.alignment = TextAnchor.UpperCenter;
        instruction.SetActive(false);
        ToggleGestureImage("");

        // Configure AirSig by specifying target
        signatureTrained = new AirSigManager.OnPlayerSignatureTrained(HandleOnPlayerSignatureTrained);
        airsigManager.onPlayerSignatureTrained += signatureTrained;
        signatureMatch = new AirSigManager.OnPlayerSignatureMatch(HandleOnPlayerSignatureMatch);
        airsigManager.onPlayerSignatureMatch += signatureMatch;

        textResult.text = defaultResultText = "Pressing trigger and write a signature in the air\nReleasing trigger when finish\nUse the Application key to reset progress";
        textMode.text   = string.Format("Mode: {0}", AirSigManager.Mode.TrainPlayerSignature.ToString());
        airsigManager.SetMode(AirSigManager.Mode.TrainPlayerSignature);
        airsigManager.SetTarget(new List <int> {
            PLAYER_SIGNATURE_INDEX
        });

        airsigManager.SetTriggerStartKeys(
            AirSigManager.Controller.RIGHT_HAND,
            SteamVR_Controller.ButtonMask.Trigger,
            AirSigManager.PressOrTouch.PRESS);


        airsigManager.SetTriggerStartKeys(
            AirSigManager.Controller.LEFT_HAND,
            SteamVR_Controller.ButtonMask.Touchpad,
            AirSigManager.PressOrTouch.PRESS);
    }
    // Use this for initialization
    void Awake()
    {
        Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);

        // Update the display text
        textResult.alignment = TextAnchor.UpperCenter;
        instruction.SetActive(false);
        ToggleGestureImage("");

        // Configure AirSig by specifying target
        signatureTrained = new AirSigManager.OnPlayerSignatureTrained(HandleOnPlayerSignatureTrained);
        airsigManager.onPlayerSignatureTrained += signatureTrained;
        signatureMatch = new AirSigManager.OnPlayerSignatureMatch(HandleOnPlayerSignatureMatch);
        airsigManager.onPlayerSignatureMatch += signatureMatch;

        ResetSignature();

        airsigManager.SetTriggerStartKeys(
            AirSigManager.Controller.RIGHT_HAND,
            SteamVR_Controller.ButtonMask.Trigger,
            AirSigManager.PressOrTouch.PRESS);


        airsigManager.SetTriggerStartKeys(
            AirSigManager.Controller.LEFT_HAND,
            SteamVR_Controller.ButtonMask.Touchpad,
            AirSigManager.PressOrTouch.PRESS);
    }
    // Use this for initialization
    void Awake()
    {
        Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);

        // Update the display text
        textResult.alignment = TextAnchor.UpperCenter;
        instruction.SetActive(false);
        ToggleGestureImage("");

        // Configure AirSig by specifying target
        signatureTrained = new AirSigManager.OnPlayerSignatureTrained(HandleOnPlayerSignatureTrained);
        airsigManager.onPlayerSignatureTrained += signatureTrained;
        signatureMatch = new AirSigManager.OnPlayerSignatureMatch(HandleOnPlayerSignatureMatch);
        airsigManager.onPlayerSignatureMatch += signatureMatch;

        ResetSignature();
    }
Beispiel #4
0
    // Use this for initialization
    void Awake()
    {
        Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);

        // Registering callback events
        playerSignatureMatch  = new AirSigManager.OnPlayerSignatureMatch(HandleOnPlayerSignatureMatch);
        signatureTrained      = new AirSigManager.OnPlayerSignatureTrained(HandleOnPlayerSignatureTrained);
        playerGestureMatch    = new AirSigManager.OnPlayerGestureMatch(HandleOnPlayerGestureMatch);
        playerGestureAdd      = new AirSigManager.OnPlayerGestureAdd(HandleOnPlayerGestureAdd);
        developerDefined      = new AirSigManager.OnDeveloperDefinedMatch(HandleOnDeveloperDefinedMatch);
        smartDeveloperDefined = new AirSigManager.OnSmartIdentifyDeveloperDefinedMatch(HandleOnSmartDeveloperDefinedMatch);

        airsigManager.onPlayerSignatureMatch               += playerSignatureMatch;
        airsigManager.onPlayerSignatureTrained             += signatureTrained;
        airsigManager.onPlayerGestureMatch                 += playerGestureMatch;
        airsigManager.onPlayerGestureAdd                   += playerGestureAdd;
        airsigManager.onDeveloperDefinedMatch              += developerDefined;
        airsigManager.onSmartIdentifyDeveloperDefinedMatch += smartDeveloperDefined;

        airsigManager.SetMode(availableMode[currentModeIndex]);
        textMode.text = availableMode[currentModeIndex].ToString();
        setModeNone();

        checkDbExist();

        airsigManager.SetTriggerStartKeys(
            AirSigManager.Controller.RIGHT_HAND,
            SteamVR_Controller.ButtonMask.Trigger,
            AirSigManager.PressOrTouch.PRESS);


        airsigManager.SetTriggerStartKeys(
            AirSigManager.Controller.LEFT_HAND,
            SteamVR_Controller.ButtonMask.Touchpad,
            AirSigManager.PressOrTouch.PRESS);
    }