Exemple #1
0
    // Use this for initialization
    void Start()
    {
        airsigManager = GameObject.Find("AirSigManager").GetComponent <AirSigManager> ();
        Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);

        // Configure AirSig by specifying target
        airsigManager.SetMode(AirSigManager.Mode.DeveloperDefined);
        airsigManager.SetClassifier("AtDefThrow", "");
        airsigManager.SetDeveloperDefinedTarget(new List <string> {
            "C", "AttackPunchSimple", "DefenseShieldCross"
        });                                                                                                                   // Just in case the order here matters, list them in the order they were added to the pack on the AirSig website.
        developerDefined = new AirSigManager.OnDeveloperDefinedMatch(HandleOnDeveloperDefinedMatch);
        airsigManager.onDeveloperDefinedMatch += developerDefined;
        checkDbExist();

        // Set each controller as an AirSig gesture trigger, and which button activates the recording
        airsigManager.SetTriggerStartKeys(
            AirSigManager.Controller.RIGHT_HAND,
            SteamVR_Controller.ButtonMask.Trigger,
            AirSigManager.PressOrTouch.PRESS);

        airsigManager.SetTriggerStartKeys(
            AirSigManager.Controller.LEFT_HAND,
            SteamVR_Controller.ButtonMask.Trigger,              // NOTE: Potential gesture bar fix by putting this line in with case 2 below vvvvvv
            AirSigManager.PressOrTouch.PRESS);                  // NOTE: May also break AirSig, who knows?

        if (SceneManager.GetActiveScene().name == "VRPUNScene")
        {
            UnlockNext(0);
        }
    }
    // 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
        developerDefined = new AirSigManager.OnDeveloperDefinedMatch(HandleOnDeveloperDefinedMatch);
        airsigManager.onDeveloperDefinedMatch += developerDefined;
        smartDeveloperDefined = new AirSigManager.OnSmartIdentifyDeveloperDefinedMatch(HandleOnSmartDeveloperDefinedMatch);
        airsigManager.onSmartIdentifyDeveloperDefinedMatch += smartDeveloperDefined;

        ResetSmartGesture();

        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);
    }
Exemple #3
0
    // Use this for initialization
    void Awake()
    {
        Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);

        // Update the display text
        //textMode.text = string.Format("Mode: {0}", AirSigManager.Mode.DeveloperDefined.ToString());
        // textResult.text = defaultResultText = "Pressing trigger and write symbol in the air\nReleasing trigger when finish";
        //textResult.alignment = TextAnchor.UpperCenter;
        instruction.SetActive(false);
        ToggleGestureImage("All");

        // Configure AirSig by specifying target
        developerDefined = new AirSigManager.OnDeveloperDefinedMatch(HandleOnDeveloperDefinedMatch);
        airsigManager.onDeveloperDefinedMatch += developerDefined;
        airsigManager.SetMode(AirSigManager.Mode.DeveloperDefined);
        airsigManager.SetDeveloperDefinedTarget(new List <string> {
            "Circle", "Square"
        });
        airsigManager.SetClassifier("SquareCircle", "");

        checkDbExist();

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


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

        rc = GameObject.Find("Controller (right)").GetComponent <RightController>();
    }
Exemple #4
0
 void OnEnable()
 {
     if (!rightGrab)
     {
         rightGrab = GameObject.Find("Controller (right)").GetComponent <ViveController>();
     }
     //if (!airsigManager)
     // {
     airsigManager = GameObject.Find("AirSigManager").GetComponent <AirSigManager>();
     // }
     airsigManager.SetMode(AirSigManager.Mode.DeveloperDefined);
     //airsigManager.SetDeveloperDefinedTarget(List<string> "Pickaxe");
     airsigManager.SetClassifier(
         "Pickaxe", "");
     airsigManager.SetTriggerStartKeys(
         AirSigManager.Controller.RIGHT_HAND,
         SteamVR_Controller.ButtonMask.Trigger,
         AirSigManager.PressOrTouch.PRESS);
     airsigManager.SetDeveloperDefinedTarget(
         new List <string> {
         "Pickaxe",
         "DOWN"
     }
         );
     developerGesture =
         new AirSigManager.OnDeveloperDefinedMatch(
             HandleOnDeveloperDefinedMatch);
     airsigManager.onDeveloperDefinedMatch +=
         developerGesture;
 }
    void Awake()
    {
        // Get PAD Manager
        padManager = GetComponent <PADManager>();

        // 1. Use SetMode to configure AirSig function
        airsigManager.SetMode(
            AirSigManager.Mode.DeveloperDefined);

        // 2. Set classifier and sub classifier
        airsigManager.SetClassifier(
            "Project_Gestures", "");

        // 3. Use SetDeveloperDefinedTarget to configure
        // targets for identification function
        airsigManager.SetDeveloperDefinedTarget(
            new List <string> {
            "WAVE",
            "Thrust",
            "Shake",
            "Spooky"
        }
            );
        // 4. Register callback for identification
        // result
        developerGesture =
            new AirSigManager.OnDeveloperDefinedMatch(
                HandleOnDeveloperDefinedMatch);
        airsigManager.onDeveloperDefinedMatch +=
            developerGesture;
    }
    // Use this for initialization
    void Awake()
    {
        Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);

        spellEngine       = gameObject.GetComponent <SpellEngine>();
        airsigManager     = gameObject.GetComponent <AirSigManager>();
        masterGameManager = GameObject.FindWithTag("GameController").GetComponent <MasterGameManager>();
        // Update the display text
        //textMode.text = string.Format("Mode: {0}", AirSigManager.Mode.DeveloperDefined.ToString());
        //textResult.text = defaultResultText = "Pressing trigger and write symbol in the air\nReleasing trigger when finish";
        //textResult.alignment = TextAnchor.UpperCenter;
        //instruction.SetActive(false);
        //ToggleGestureImage("All");

        // Configure AirSig by specifying target
        developerDefined = new AirSigManager.OnDeveloperDefinedMatch(HandleOnDeveloperDefinedMatch);
        airsigManager.onDeveloperDefinedMatch += developerDefined;
        airsigManager.SetMode(AirSigManager.Mode.DeveloperDefined);
        List <string> temp = new List <string>();

        temp.Add("Dot");
        temp.Add("Line");
        temp.Add("Circle");
        //temp.Add("Square");
        temp.Add("Triangle");

        airsigManager.SetDeveloperDefinedTarget(temp);
        airsigManager.SetClassifier("FinalGestureProfile", "");

        //airsigManager.SetDeveloperDefinedTarget(spellEngine.getCompleteSpellPartsNameList());
        //airsigManager.SetClassifier("GestureProfile1", "");
        //airsigManager.SetClassifier("SpellCoresV1", "");

        /*developerDefinedCore = new AirSigManager.OnDeveloperDefinedMatch(HandleOnDeveloperDefinedMatchCore);
         * airsigManager.onDeveloperDefinedMatch += developerDefinedCore;
         * airsigManager.SetMode(AirSigManager.Mode.DeveloperDefined);
         * airsigManager.SetDeveloperDefinedTarget(spellEngine.getCompleteSpellPartsNameList());
         * airsigManager.SetClassifier("GestureProfile1", "");*/



        //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);
    }
    // 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
        developerDefined = new AirSigManager.OnDeveloperDefinedMatch(HandleOnDeveloperDefinedMatch);
        airsigManager.onDeveloperDefinedMatch += developerDefined;
        smartDeveloperDefined = new AirSigManager.OnSmartIdentifyDeveloperDefinedMatch(HandleOnSmartDeveloperDefinedMatch);
        airsigManager.onSmartIdentifyDeveloperDefinedMatch += smartDeveloperDefined;

        ResetSmartGesture();
    }
Exemple #8
0
    private void OnEnable()
    {
        controllerManager = rightHandControl.GetComponent <ControllerManager>();

        developerDefined = new AirSigManager.OnDeveloperDefinedMatch(HandleOnDeveloperDefinedMatch);
        airsigManager.onDeveloperDefinedMatch += developerDefined;
        airsigManager.SetDeveloperDefinedTarget(new List <string> {
            "BOTRN", "DOWN"
        });
        airsigManager.SetClassifier("FrostGestureProfile", "");

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

        trackedObj = GetComponent <SteamVR_TrackedObject>();
    }
    // Use this for initialization
    void Awake()
    {
        Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);

        // Update the display text
        //textMode.text = string.Format("Mode: {0}", AirSigManager.Mode.DeveloperDefined.ToString());
        //textResult.text = defaultResultText = "Pressing trigger and write symbol in the air\nReleasing trigger when finish";
        //textResult.alignment = TextAnchor.UpperCenter;
        instruction.SetActive(false);
        ToggleGestureImage("All");
        Debug.LogWarning("DEVELOPER DEFINED AWAKE");
        // Configure AirSig by specifying target
        developerDefined = new AirSigManager.OnDeveloperDefinedMatch(HandleOnDeveloperDefinedMatch);
        airsigManager.onDeveloperDefinedMatch += developerDefined;
        airsigManager.SetMode(AirSigManager.Mode.DeveloperDefined);
        airsigManager.SetDeveloperDefinedTarget(new List <string> {
            "HEART", "C", "DOWN"
        });
        airsigManager.SetClassifier("SampleGestureProfile", "");

        checkDbExist();
    }
Exemple #10
0
    // Use this for initialization
    void Awake()
    {
        Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);
        sourceDuck = GetComponent <AudioSource>();
        // sourceDuck.enabled = false;
        // Update the display text
        AirSigManager.Mode Mode = AirSigManager.Mode.DeveloperDefined;
        textMode.text        = string.Format("Mode: {0}", Mode.ToString());
        textResult.text      = defaultResultText = "Pressing trigger on the right hand and write\ntriangle symbol in the air\nReleasing trigger when finish\nPress left hand trigger to shoot\nwrite heart symbol to get a shield";
        textResult.alignment = TextAnchor.UpperCenter;
        instruction.SetActive(false);
        ToggleGestureImage("All");

        // Configure AirSig by specifying target
        developerDefined = new AirSigManager.OnDeveloperDefinedMatch(HandleOnDeveloperDefinedMatch);
        airsigManager.onDeveloperDefinedMatch += developerDefined;
        airsigManager.SetMode(Mode);
        airsigManager.SetDeveloperDefinedTarget(new List <string> {
            "HEART", "C", "DOWN", "Triangle"
        });
        airsigManager.SetClassifier("Spellcasters Mini Test", "");
        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);

        hasAmmo = false;
        blackHole.SetActive(false);
        playerHealth.text = "Player Health:" + pHealth.ToString();
    }
Exemple #11
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);
    }
Exemple #12
0
    // Use this for initialization
    void Awake()
    {
        //Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);

        // Update the display text

        /*  textMode.text = string.Format("Mode: {0}", AirSigManager.Mode.DeveloperDefined.ToString());
         * textResult.text = defaultResultText = "Pressing trigger and write symbol in the air\nReleasing trigger when finish";
         * textResult.alignment = TextAnchor.UpperCenter;
         * instruction.SetActive(false);
         * ToggleGestureImage("All");*/

        // Configure AirSig by specifying target
        developerDefined = new AirSigManager.OnDeveloperDefinedMatch(HandleOnDeveloperDefinedMatch);
        airsigManager.onDeveloperDefinedMatch += developerDefined; // 위의 함수를 등록
        airsigManager.SetMode(AirSigManager.Mode.DeveloperDefined);
        airsigManager.SetDeveloperDefinedTarget(new List <string> {
            "HEART", "IceSpear", "FireBall", "thunder_ver2", "Shield2"
        });
        //airsigManager.SetDeveloperDefinedTarget(new List<string>(magicManager.MagicNames));
        airsigManager.SetClassifier("thunder_ver2", "");

        checkDbExist();

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

        /*airsigManager.SetTriggerStartKeys(
        *  AirSigManager.Controller.LEFT_HAND,
        *  SteamVR_Controller.ButtonMask.Trigger,
        *  AirSigManager.PressOrTouch.PRESS);*/

        //vrController = ViveController
    }