Esempio n. 1
0
    public void GroundCheck()
    {
        wasPreviouslyGrounded.SetValue(isGrounded);
        RaycastHit hitInfo;

        if (Physics.SphereCast(transform.position, capsule.radius * (1.0f - shellOffset), Vector3.down, out hitInfo,
                               ((capsule.height / 2f) - capsule.radius) + groundCheckDistance, Physics.AllLayers, QueryTriggerInteraction.Ignore))
        {
            isGrounded.SetValue(true);
            m_GroundContactNormal.SetValue(hitInfo.normal);
        }
        else
        {
            isGrounded.SetValue(false);
            m_GroundContactNormal.SetValue(Vector3.up);
        }

        if (!wasPreviouslyGrounded && isGrounded)
        {
            if (isJumping)
            {
                isJumping.SetValue(false);
            }
        }
    }
Esempio n. 2
0
 // Update is called once per frame
 void Update()
 {
     SpecrumLow.SetValue(lowInput);
     SpecrumMid.SetValue(midInput);
     SpecrumHigh.SetValue(highInput);
     SpecrumLMH.SetValue(new Vector3(lowInput, midInput, highInput));
 }
Esempio n. 3
0
        public override void Update()
        {
            // TODO: Potential issue to solve here is that if second attack is retriggered too quickly, maybe the
            //     it's downtime wont be detected by dependent listeners?
            // also, don't actually want to block this way. example, dash can cancel attack animation?
            if (primaryAbilityBuffer.IsBlocked())
            {
                return;
            }

            if (primaryAbilityBuffer.IsBufferedInputAvailable(state => state.state == 1))
            {
                // if the player is grounded, block right and left movement input, to allow the ability's movement
                //     control to take over unimpeded.
                if (grounded.Value)
                {
                    // TODO: block the non buffered inputs
                    // rightMovementBuffer.BlockExecution(blockingTime);
                    // leftMovementBuffer.BlockExecution(blockingTime);
                }

                // block self for specified number of frames to prevent re-triggering before desired
                primaryAbilityBuffer.BlockExecution(blockingTime);
                primaryAbilityBuffer.ExecuteBufferOnCondition(state => state.state == 1);

                // Here if hit an npc, don't do primary ability
                Vector2 playerToMouseVector =
                    Input.mousePosition -
                    cameraVariable.Value.WorldToScreenPoint(playerPosition.Value);
                float x = playerToMouseVector.x;
                float y = playerToMouseVector.y;
                if (Mathf.Abs(x) > Mathf.Abs(y))
                {
                    primaryAbilityDirection.SetValue(new Vector2(x > 0 ? 1 : -1, 0));
                }
                else
                {
                    primaryAbilityDirection.SetValue(new Vector2(0, y > 0 ? 1 : -1));
                }

                attacking.SetValue(true);
                return;
            }

            attacking.SetValue(false);
        }
Esempio n. 4
0
 void Update()
 {
     if (Input.GetMouseButtonDown(0))
     {
         ClickCoordinates.SetValue(Camera.main.ScreenToWorldPoint(Input.mousePosition));
         ClickEvent.Raise();
     }
 }
 void Update()
 {
     _inputPairs.ForEach(inputPair =>
     {
         inputPair.controlVariable.SetValue(InputConverter.InputToIntValue(inputPair.keyCode));
     });
     secondDirectionalControl.SetValue(Input.mousePosition);
 }
        public override void Update()
        {
            if (grounded.Value)
            {
                _dashAvailable = true;
            }

            if (secondaryAbilityBuffer.IsBlocked())
            {
                if (ceilingHit.Value && dashing.Value)
                {
                    _dashAvailable = false;
                    dashing.SetValue(false);
                }
                return;
            }

            if (_dashAvailable && secondaryAbilityBuffer.IsBufferedInputAvailable(state => state.state == 1))
            {
                secondaryAbilityBuffer.BlockExecution(blockingTime);
                secondaryAbilityBuffer.ExecuteBufferOnCondition(state => state.state == 1);

                dashing.SetValue(true);

                // Here if hit an npc, don't do primary ability
                Vector2 playerToMouseVector = GetPlayerToMouseVector();
                _dashAvailable = false;

                if (grounded.Value)
                {
                    secondaryAbilityDirection.SetValue(
                        GetNearestHorizontalDirection(playerToMouseVector.x)
                        );
                    return;
                }

                secondaryAbilityDirection.SetValue(playerToMouseVector.normalized);
                return;
            }

            dashing.SetValue(false);
        }
Esempio n. 7
0
        //EMPTY
        #region PUBLIC_METHODS
        #endregion

        #region PRIVATE_METHODS
        /// <summary>
        /// Handle the Left Controller input and put them in the Events
        /// </summary>
        void CheckLeftControllerInput()
        {
            BoolVariable temp;

            #region TRIGGER
            temp = LeftVariablesDictionnary.Get("TriggerIsDown");

            if (!temp.Value && OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger))
            {
                temp.SetValue(true);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftTriggerDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && !OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger))
            {
                temp.SetValue(false);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftTriggerUp");
                _leftEvent.Raise();
            }
            #endregion TRIGGER

            #region THUMBSTICK
            temp = LeftVariablesDictionnary.Get("ThumbIsDown");

            LeftThumbOrientation.SetValue(OVRInput.Get(OVRInput.Axis2D.PrimaryThumbstick));

            if (OVRInput.Get(OVRInput.Button.PrimaryThumbstick))
            {
                temp.SetValue(true);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftThumbDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && !OVRInput.Get(OVRInput.Button.PrimaryThumbstick))
            {
                temp.SetValue(false);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftThumbUp");
                _leftEvent.Raise();
            }

            if (OVRInput.Get(OVRInput.Touch.PrimaryThumbstick))
            {
                _leftEventBool = (GameEventBool)LeftEventsDictionnary.Get("LeftThumbTouching");
                _leftEventBool.Raise(true);
            }
            else if (!OVRInput.Get(OVRInput.Touch.PrimaryThumbstick))
            {
                _leftEventBool = (GameEventBool)LeftEventsDictionnary.Get("LeftThumbTouching");
                _leftEventBool.Raise(false);
            }
            #endregion THUMBSTICK

            #region GRIP
            temp = LeftVariablesDictionnary.Get("GripIsDown");

            if (!temp.Value && OVRInput.Get(OVRInput.Button.PrimaryHandTrigger))
            {
                temp.SetValue(true);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftGripDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && !OVRInput.Get(OVRInput.Button.PrimaryHandTrigger))
            {
                temp.SetValue(false);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftGripUp");
                _leftEvent.Raise();
            }
            #endregion GRIP

            #region MENU
            temp = LeftVariablesDictionnary.Get("MenuIsDown");

            if (!temp.Value && OVRInput.Get(OVRInput.Button.Start))
            {
                temp.SetValue(true);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftMenuDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && !OVRInput.Get(OVRInput.Button.Start))
            {
                temp.SetValue(false);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftMenuUp");
                _leftEvent.Raise();
            }
            #endregion MENU

            #region Button X
            temp = LeftVariablesDictionnary.Get("XButtonIsDown");

            if (!temp.Value && OVRInput.Get(OVRInput.Button.Three))
            {
                temp.SetValue(true);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("XButtonDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && !OVRInput.Get(OVRInput.Button.Three))
            {
                temp.SetValue(false);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("XButtonUp");
                _leftEvent.Raise();
            }
            #endregion Button X

            #region Button Y
            temp = LeftVariablesDictionnary.Get("YButtonIsDown");

            if (!temp.Value && OVRInput.Get(OVRInput.Button.Four))
            {
                temp.SetValue(true);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("YButtonDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && !OVRInput.Get(OVRInput.Button.Four))
            {
                temp.SetValue(false);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("YButtonUp");
                _leftEvent.Raise();
            }
            #endregion Button Y
        }
Esempio n. 8
0
        /// <summary>
        /// Handle the Right Controller input and put them in the Events
        /// </summary>
        void CheckRightControllerInput()
        {
            BoolVariable temp;

            #region TRIGGER
            temp = RightVariablesDictionnary.Get("TriggerIsDown");

            if (!temp.Value && OVRInput.Get(OVRInput.Button.SecondaryIndexTrigger))
            {
                temp.SetValue(true);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightTriggerDown");
                _rightEvent.Raise();
            }
            else if (temp.Value && !OVRInput.Get(OVRInput.Button.SecondaryIndexTrigger))
            {
                temp.SetValue(false);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightTriggerUp");
                _rightEvent.Raise();
            }
            #endregion TRIGGER

            #region THUMBSTICK
            temp = RightVariablesDictionnary.Get("ThumbIsDown");

            RightThumbOrientation.SetValue(OVRInput.Get(OVRInput.Axis2D.SecondaryThumbstick));

            if (OVRInput.Get(OVRInput.Button.SecondaryThumbstick))
            {
                temp.SetValue(true);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightThumbDown");
                _rightEvent.Raise();
            }
            else if (temp.Value && !OVRInput.Get(OVRInput.Button.SecondaryThumbstick))
            {
                temp.SetValue(false);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightThumbUp");
                _rightEvent.Raise();
            }

            if (OVRInput.Get(OVRInput.Touch.SecondaryThumbstick))
            {
                _rightEventBool = (GameEventBool)RightEventsDictionnary.Get("RightThumbTouching");
                _rightEventBool.Raise(true);
            }
            else if (!OVRInput.Get(OVRInput.Touch.SecondaryThumbstick))
            {
                _rightEventBool = (GameEventBool)RightEventsDictionnary.Get("RightThumbTouching");
                _rightEventBool.Raise(false);
            }
            #endregion THUMBSTICK

            #region GRIP
            temp = RightVariablesDictionnary.Get("GripIsDown");

            if (!temp.Value && OVRInput.Get(OVRInput.Button.SecondaryHandTrigger))
            {
                temp.SetValue(true);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightGripDown");
                _rightEvent.Raise();
            }
            else if (temp.Value && !OVRInput.Get(OVRInput.Button.SecondaryHandTrigger))
            {
                temp.SetValue(false);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightGripUp");
                _rightEvent.Raise();
            }
            #endregion GRIP

            //No Right menu button on the oculus

            #region Button A
            temp = RightVariablesDictionnary.Get("AButtonIsDown");

            if (!temp.Value && OVRInput.Get(OVRInput.Button.One))
            {
                temp.SetValue(true);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("AButtonDown");
                _rightEvent.Raise();
            }
            else if (temp.Value && !OVRInput.Get(OVRInput.Button.One))
            {
                temp.SetValue(false);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("AButtonUp");
                _rightEvent.Raise();
            }
            #endregion

            #region Button B
            temp = RightVariablesDictionnary.Get("BButtonIsDown");

            if (!temp.Value && OVRInput.Get(OVRInput.Button.Two))
            {
                temp.SetValue(true);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("BButtonDown");
                _rightEvent.Raise();
            }
            else if (temp.Value && !OVRInput.Get(OVRInput.Button.Two))
            {
                temp.SetValue(false);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("BButtonUp");
                _rightEvent.Raise();
            }
            #endregion
        }
Esempio n. 9
0
 public void SetTransformProperty(Vector3 pos, Quaternion rot, bool flag)
 {
     position.SetValue(pos);
     rotation         = rot;
     isAttachToAnchor = flag;
 }
 void FixedUpdate()
 {
     playerPosition.SetValue(transform.position);
 }
Esempio n. 11
0
        //EMPTY
        #region PUBLIC_METHODS
        #endregion PUBLIC_METHODS

        #region PRIVATE_METHODS
        /// <summary>
        /// Handle the Left Controller input and put them in the Events
        /// </summary>
        void CheckLeftControllerInput()
        {
            BoolVariable temp;

            #region TRIGGER
            temp = LeftVariablesDictionnary.Get("TriggerIsDown");

            if (!temp.Value && LeftController.GetHairTriggerDown())
            {
                temp.SetValue(true);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftTriggerDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && LeftController.GetHairTriggerUp())
            {
                temp.SetValue(false);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftTriggerUp");
                _leftEvent.Raise();
            }
            #endregion TRIGGER

            #region TOUCHPAD
            temp = LeftVariablesDictionnary.Get("ThumbIsDown");

            LeftThumbOrientation.SetValue(LeftController.GetAxis());

            if (LeftController.GetPressDown(SteamVR_Controller.ButtonMask.Touchpad))
            {
                temp.SetValue(true);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftThumbDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && LeftController.GetPressUp(SteamVR_Controller.ButtonMask.Touchpad))
            {
                temp.SetValue(false);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftThumbUp");
                _leftEvent.Raise();
            }

            if (LeftController.GetTouchDown(SteamVR_Controller.ButtonMask.Touchpad))
            {
                _leftEventBool = (GameEventBool)LeftEventsDictionnary.Get("LeftThumbTouching");
                _leftEventBool.Raise(true);
            }
            else if (LeftController.GetTouchUp(SteamVR_Controller.ButtonMask.Touchpad))
            {
                _leftEventBool = (GameEventBool)LeftEventsDictionnary.Get("LeftThumbTouching");
                _leftEventBool.Raise(false);
            }
            #endregion TOUCHPAD

            #region GRIP
            temp = LeftVariablesDictionnary.Get("GripIsDown");

            if (!temp.Value && LeftController.GetPressDown(SteamVR_Controller.ButtonMask.Grip))
            {
                temp.SetValue(true);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftGripDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && LeftController.GetPressUp(SteamVR_Controller.ButtonMask.Grip))
            {
                temp.SetValue(false);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftGripUp");
                _leftEvent.Raise();
            }
            #endregion GRIP

            #region MENU
            temp = LeftVariablesDictionnary.Get("MenuIsDown");

            if (!temp.Value && LeftController.GetPressDown(SteamVR_Controller.ButtonMask.ApplicationMenu))
            {
                temp.SetValue(true);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftMenuDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && LeftController.GetPressUp(SteamVR_Controller.ButtonMask.ApplicationMenu))
            {
                temp.SetValue(false);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftMenuUp");
                _leftEvent.Raise();
            }
            #endregion MENU
        }
Esempio n. 12
0
        //EMPTY
        #region PUBLIC_METHODS
        #endregion

        #region PRIVATE_METHODS
        /// <summary>
        /// Handle the Left Controller input and put them in the Events
        /// </summary>
        void CheckLeftControllerInput()
        {
            BoolVariable temp;

            //Left Click
            #region TRIGGER
            temp = LeftVariablesDictionnary.Get("TriggerIsDown");

            if (!temp.Value && Input.GetMouseButtonDown(0))
            {
                temp.SetValue(true);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftTriggerDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && Input.GetMouseButtonUp(0))
            {
                temp.SetValue(false);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftTriggerUp");
                _leftEvent.Raise();
            }
            #endregion TRIGGERa

            //W, A, S and D
            #region THUMB
            temp = LeftVariablesDictionnary.Get("ThumbIsDown");

            //GO UP
            if (!temp.Value && Input.GetKeyDown(KeyCode.W))
            {
                temp.SetValue(true);
                LeftThumbOrientation.SetValue(Vector3.forward);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftThumbDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && LeftThumbOrientation.Value.Equals(Vector3.forward) && Input.GetKeyUp(KeyCode.W))
            {
                temp.SetValue(false);
                LeftThumbOrientation.SetValue(Vector3.zero);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftThumbUp");
                _leftEvent.Raise();
            }

            // GO DOWN
            if (!temp.Value && Input.GetKeyDown(KeyCode.S))
            {
                temp.SetValue(true);
                LeftThumbOrientation.SetValue(Vector3.back);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftThumbDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && LeftThumbOrientation.Value.Equals(Vector3.back) && Input.GetKeyUp(KeyCode.S))
            {
                temp.SetValue(false);
                LeftThumbOrientation.SetValue(Vector3.zero);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftThumbUp");
                _leftEvent.Raise();
            }

            //GO RIGHT
            if (!temp.Value && Input.GetKeyDown(KeyCode.D))
            {
                temp.SetValue(true);
                LeftThumbOrientation.SetValue(Vector3.right);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftThumbDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && LeftThumbOrientation.Value.Equals(Vector3.right) && Input.GetKeyUp(KeyCode.D))
            {
                temp.SetValue(false);
                LeftThumbOrientation.SetValue(Vector3.zero);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftThumbUp");
                _leftEvent.Raise();
            }

            //GO LEFT
            if (!temp.Value && Input.GetKeyDown(KeyCode.A))
            {
                temp.SetValue(true);
                LeftThumbOrientation.SetValue(Vector3.left);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftThumbDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && LeftThumbOrientation.Value.Equals(Vector3.left) && Input.GetKeyUp(KeyCode.A))
            {
                temp.SetValue(false);
                LeftThumbOrientation.SetValue(Vector3.zero);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftThumbUp");
                _leftEvent.Raise();
            }
            #endregion THUMB

            //Left Shift
            #region GRIP
            temp = LeftVariablesDictionnary.Get("GripIsDown");

            if (!temp.Value && Input.GetKeyDown(KeyCode.LeftShift))
            {
                temp.SetValue(true);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftGripDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && Input.GetKeyUp(KeyCode.LeftShift))
            {
                temp.SetValue(false);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftGripUp");
                _leftEvent.Raise();
            }
            #endregion GRIP

            //Left Control
            #region MENU
            temp = LeftVariablesDictionnary.Get("MenuIsDown");

            if (!temp.Value && Input.GetKeyDown(KeyCode.LeftControl))
            {
                temp.SetValue(true);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftMenuDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && Input.GetKeyUp(KeyCode.LeftControl))
            {
                temp.SetValue(false);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("LeftMenuUp");
                _leftEvent.Raise();
            }
            #endregion MENU

            #region OCULUS_PARTICULARITIES

            //F
            #region X BUTTON
            temp = LeftVariablesDictionnary.Get("XButtonIsDown");

            if (!temp.Value && Input.GetKeyDown(KeyCode.F))
            {
                temp.SetValue(true);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("XButtonDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && Input.GetKeyUp(KeyCode.F))
            {
                temp.SetValue(false);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("XButtonUp");
                _leftEvent.Raise();
            }
            #endregion X BUTTON

            //R
            #region Y BUTTON
            temp = LeftVariablesDictionnary.Get("YButtonIsDown");

            if (!temp.Value && Input.GetKeyDown(KeyCode.R))
            {
                temp.SetValue(true);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("YButtonDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && Input.GetKeyUp(KeyCode.R))
            {
                temp.SetValue(false);
                _leftEvent = (GameEvent)LeftEventsDictionnary.Get("YButtonUp");
                _leftEvent.Raise();
            }
            #endregion Y BUTTON

            #endregion OCULUS_PARTICULARITIES
        }
Esempio n. 13
0
        /// <summary>
        /// Handle the Right Controller input and put them in the Events
        /// </summary>
        void CheckRightControllerInput()
        {
            BoolVariable temp;

            //Right Click
            #region TRIGGER
            temp = RightVariablesDictionnary.Get("TriggerIsDown");

            if (!temp.Value && Input.GetMouseButtonDown(1))
            {
                temp.SetValue(true);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightTriggerDown");
                _rightEvent.Raise();
            }
            else if (temp.Value && Input.GetMouseButtonUp(1))
            {
                temp.SetValue(false);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightTriggerUp");
                _rightEvent.Raise();
            }
            #endregion TRIGGER

            //Up, Down, Left and Right Arrows
            #region THUMB
            temp = RightVariablesDictionnary.Get("ThumbIsDown");

            //GO UP
            if (!temp.Value && Input.GetKeyDown(KeyCode.UpArrow))
            {
                RightThumbOrientation.SetValue(Vector3.forward);
                temp.SetValue(true);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightThumbDown");
                _rightEvent.Raise();
            }
            else if (temp.Value && RightThumbOrientation.Value.Equals(Vector3.forward) && Input.GetKeyUp(KeyCode.UpArrow))
            {
                RightThumbOrientation.SetValue(Vector3.zero);
                temp.SetValue(false);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightThumbUp");
                _rightEvent.Raise();
            }

            //GO DOWN
            if (!temp.Value && Input.GetKeyDown(KeyCode.DownArrow))
            {
                RightThumbOrientation.SetValue(Vector3.back);
                temp.SetValue(true);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightThumbDown");
                _rightEvent.Raise();
            }
            else if (temp.Value && RightThumbOrientation.Value.Equals(Vector3.back) && Input.GetKeyUp(KeyCode.DownArrow))
            {
                RightThumbOrientation.SetValue(Vector3.zero);
                temp.SetValue(false);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightThumbUp");
                _rightEvent.Raise();
            }

            //GO RIGHT
            if (!temp.Value && Input.GetKeyDown(KeyCode.RightArrow))
            {
                RightThumbOrientation.SetValue(Vector3.right);
                temp.SetValue(true);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightThumbDown");
                _rightEvent.Raise();
            }
            else if (temp.Value && RightThumbOrientation.Value.Equals(Vector3.right) && Input.GetKeyUp(KeyCode.RightArrow))
            {
                RightThumbOrientation.SetValue(Vector3.zero);
                temp.SetValue(false);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightThumbUp");
                _rightEvent.Raise();
            }

            //GO LEFT
            if (!temp.Value && Input.GetKeyDown(KeyCode.LeftArrow))
            {
                RightThumbOrientation.SetValue(Vector3.left);
                temp.SetValue(true);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightThumbDown");
                _rightEvent.Raise();
            }
            else if (temp.Value && RightThumbOrientation.Value.Equals(Vector3.left) && Input.GetKeyUp(KeyCode.LeftArrow))
            {
                RightThumbOrientation.SetValue(Vector3.zero);
                temp.SetValue(false);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightThumbUp");
                _rightEvent.Raise();
            }
            #endregion THUMB

            //Right Shift
            #region GRIP
            temp = RightVariablesDictionnary.Get("GripIsDown");

            if (!temp.Value && Input.GetKeyDown(KeyCode.RightShift))
            {
                temp.SetValue(true);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightGripDown");
                _rightEvent.Raise();
            }
            else if (temp.Value && Input.GetKeyUp(KeyCode.RightShift))
            {
                temp.SetValue(false);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightGripUp");
                _rightEvent.Raise();
            }
            #endregion GRIP

            #region VIVE_PARTICULARITY

            //Right Control
            #region MENU
            temp = RightVariablesDictionnary.Get("MenuIsDown");

            if (!temp.Value && Input.GetKeyDown(KeyCode.RightControl))
            {
                temp.SetValue(true);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightMenuDown");
                _rightEvent.Raise();
            }
            else if (temp.Value && Input.GetKeyUp(KeyCode.RightControl))
            {
                temp.SetValue(false);
                _rightEvent = (GameEvent)RightEventsDictionnary.Get("RightMenuUp");
                _rightEvent.Raise();
            }
            #endregion MENU

            #endregion VIVE_PARTICULARITY

            #region OCULUS_PARTICULARITIES

            //L
            #region A BUTTON
            temp = RightVariablesDictionnary.Get("AButtonIsDown");

            if (!temp.Value && Input.GetKeyDown(KeyCode.L))
            {
                temp.SetValue(true);
                _leftEvent = (GameEvent)RightEventsDictionnary.Get("AButtonDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && Input.GetKeyUp(KeyCode.L))
            {
                temp.SetValue(false);
                _leftEvent = (GameEvent)RightEventsDictionnary.Get("AButtonUp");
                _leftEvent.Raise();
            }
            #endregion A BUTTON

            //O
            #region B BUTTON
            temp = RightVariablesDictionnary.Get("BButtonIsDown");

            if (!temp.Value && Input.GetKeyDown(KeyCode.O))
            {
                temp.SetValue(true);
                _leftEvent = (GameEvent)RightEventsDictionnary.Get("BButtonDown");
                _leftEvent.Raise();
            }
            else if (temp.Value && Input.GetKeyUp(KeyCode.O))
            {
                temp.SetValue(false);
                _leftEvent = (GameEvent)RightEventsDictionnary.Get("BButtonUp");
                _leftEvent.Raise();
            }
            #endregion B BUTTON

            #endregion OCULUS_PARTICULARITIES
        }
Esempio n. 14
0
 private void Update()
 {
     playerPosition.SetValue(transform.position);
 }
Esempio n. 15
0
 private void OnEnable()
 {
     _lastPickUpLocation.SetValue(transform.position);
     anchorTransform.SetCurrentSelectedPiece(jewellerType.pieceType);
     _shockWave.Explode(transform.position);
 }