// Use this for initialization
    void Awake()
    {
        Instance = this;

        // Set up a GestureRecognizer to detect Select gestures.
        recognizer              = new GestureRecognizer();
        recognizer.TappedEvent += (source, tapCount, ray) =>
        {
            Debug.Log("tap");
            status.GetComponent <TextMesh>().text = "taking photo...";
            status.SetActive(true);
            PhotoCapture.CreateAsync(false, OnPhotoCaptureCreated);
        };
        recognizer.StartCapturingGestures();

        PhotoCapture.CreateAsync(false, OnPhotoCaptureCreated);

        if (File.Exists("config.cfg"))
        {
            var cfg         = Configuration.LoadFromFile("config.cfg");
            var apiSettings = cfg["API"];
            FaceAPIKey    = apiSettings["FaceAPIKey"].StringValue;
            EmotionAPIKey = apiSettings["EmotionAPIKey"].StringValue;
            OpenFaceUrl   = apiSettings["OpenFaceUrl"].StringValue;
            Debug.Log("loaded settings from config.cfg");
        }
    }
Exemple #2
0
    // Use this for initialization
    void Awake()
    {
        Instance = this;

        // Set up a GestureRecognizer to detect Select gestures.
        recognizer              = new GestureRecognizer();
        recognizer.TappedEvent += (source, tapCount, ray) =>
        {
            Debug.Log("tap");
            if (!_busy)
            {
                _busy = true;
                status.GetComponent <TextMesh>().text = "taking photo...";
                status.SetActive(true);
                PhotoCapture.CreateAsync(false, OnPhotoCaptureCreated);
            }
            else
            {
                status.GetComponent <TextMesh>().text = "busy...";
                status.SetActive(true);
            }
        };
        recognizer.StartCapturingGestures();
        status.GetComponent <TextMesh>().text = "taking photo...";
        _busy = true;

        PhotoCapture.CreateAsync(false, OnPhotoCaptureCreated);
    }
    void Awake()
    {
        Instance = this;

        // Set up gesture recognizer for firing cannon
        _fireCannonGestureHandler = new GestureRecognizer();
        _fireCannonGestureHandler.SetRecognizableGestures(GestureSettings.Tap | GestureSettings.Hold);
        _fireCannonGestureHandler.TappedEvent        += SingleFire;
        _fireCannonGestureHandler.HoldStartedEvent   += FiringStarted;
        _fireCannonGestureHandler.HoldCompletedEvent += FiringCompleted;
        _fireCannonGestureHandler.HoldCanceledEvent  += FiringCancelled;

        // Set up gesture recognizer for moving objects around
        _moveObjectGestureHandler = new GestureRecognizer();
        _moveObjectGestureHandler.SetRecognizableGestures(GestureSettings.ManipulationTranslate);
        _moveObjectGestureHandler.ManipulationStartedEvent   += MoveObjectStarted;
        _moveObjectGestureHandler.ManipulationUpdatedEvent   += MoveObjectUpdated;
        _moveObjectGestureHandler.ManipulationCompletedEvent += MoveObjectCompleted;
        _moveObjectGestureHandler.ManipulationCanceledEvent  += MoveObjectCanceled;

        // Set up gesture handler for rotating objects
        _rotateObjectGestureHandler = new GestureRecognizer();
        _rotateObjectGestureHandler.SetRecognizableGestures(GestureSettings.NavigationX | GestureSettings.NavigationY);
        _rotateObjectGestureHandler.NavigationStartedEvent   += RotateObjectStarted;
        _rotateObjectGestureHandler.NavigationUpdatedEvent   += RotateObjectUpdated;
        _rotateObjectGestureHandler.NavigationCompletedEvent += RotateObjectCompleted;
        _rotateObjectGestureHandler.NavigationCanceledEvent  += RotateObjectCanceled;
    }
 // Use this for initialization
 void Start()
 {
     // Grab the material that's on the same object as this script.
     material = this.GetComponent <Renderer>().material;
     //Grab the gesture manager.
     gestureMan = GameObject.FindGameObjectWithTag("GameController").GetComponent <GazeGestureManager>();
 }
    // Use this for initialization
    void Start()
    {
        Instance = this;

        // Set up a GestureRecognizer to detect Select gestures.
        recognizer              = new GestureRecognizer();
        recognizer.TappedEvent += OnTappedEvent;
        //recognizer.HoldStartedEvent += OnHoldStartedEvent;
        recognizer.StartCapturingGestures();
    }
 void Awake()
 {
     Instance                = this;
     recognizer              = new GestureRecognizer();
     recognizer.TappedEvent += (source, tapCount, ray) =>
     {
         if (focusedObject != null)
         {
             focusedObject.Select();
         }
     };
     recognizer.StartCapturingGestures();
 }
Exemple #7
0
    // Use this for initialization
    void Start()
    {
        Instance = this;

        // Set up a GestureRecognizer to detect Select gestures.
        recognizer         = new GestureRecognizer();
        recognizer.Tapped += (args) =>
        {
            // Send an OnSelect message to the focused object and its ancestors.
            if (FocusedObject != null)
            {
                FocusedObject.SendMessage("OnSelect", SendMessageOptions.DontRequireReceiver);
            }
        };
        recognizer.StartCapturingGestures();
    }
    void Awake()
    {
        Instance = this;

        // Set up a GestureRecognizer to detect Select gestures.
        recognizer         = new GestureRecognizer();
        recognizer.Tapped += (args) =>
        {
            Debug.Log("Air Tapped");
            //Capturing a photo to camera folder
            PhotoCapture.CreateAsync(false, OnPhotoCaptureCreated);
            //Performing facial recognition on that photo
            ProcessPhotoAsync();
        };
        recognizer.StartCapturingGestures();
    }
Exemple #9
0
    void PerformManipulationUpdate(Vector3 position)
    {
        //Grab the GazeGestureManager script to reference properites
        gestureMan = transform.parent.gameObject.GetComponent <GazeGestureManager>();

        if (gestureMan.IsManipulating)
        {
            Vector3 moveVector = Vector3.zero;
            //Calculate the moveVector as position - manipulationPreviousPosition.
            moveVector = position - manipulationPreviousPosition;

            //Update the manipulationPreviousPosition with the current position.
            manipulationPreviousPosition = position;

            //Increment this transform's position by the moveVector.
            transform.position += moveVector * 3;
        }
    }
 // Use this for initialization
 void Start()
 {
     ggm = gazeGestureManagerObject.GetComponent <GazeGestureManager>();
 }