//Delete
 void Interactible_OnDoubleClick(CONTROLLER_BUTTON obj)
 {
     if (obj == InteractButton)
     {
         Destroy(gameObject);
     }
 }
Пример #2
0
    public bool GetReleaseButton(CONTROLLER_BUTTON button)
    {
        if (Input.GetKeyUp(keyDictionary[button]) || Input.GetKeyUp(padDictionary[button]))
        {
            return(true);
        }
        if (button > CONTROLLER_BUTTON.CLOSS_RIGHT)
        {
            if (Input.GetKey(keyDictionary[button]) || Input.GetKey(padDictionary[button]))
            {
                return(true);
            }
        }
        else
        {
            if (button == CONTROLLER_BUTTON.CLOSS_UP)
            {
                if (!Input.GetKey(keyDictionary[button]) && !(Input.GetAxisRaw("GamePadVertical") == 1.0f))
                {
                    if (BeforeClossButton[0])
                    {
                        return(true);
                    }
                }
            }
            else if (button == CONTROLLER_BUTTON.CLOSS_DOWN)
            {
                if (!Input.GetKey(keyDictionary[button]) && !(Input.GetAxisRaw("GamePadVertical") == -1.0f))
                {
                    if (BeforeClossButton[1])
                    {
                        return(true);
                    }
                }
            }
            else if (button == CONTROLLER_BUTTON.CLOSS_RIGHT)
            {
                if (!Input.GetKey(keyDictionary[button]) && !(Input.GetAxisRaw("GamePadHorizontal") == 1.0f))
                {
                    if (BeforeClossButton[3])
                    {
                        return(true);
                    }
                }
            }
            else
            {
                if (!Input.GetKey(keyDictionary[button]) && !(Input.GetAxisRaw("GamePadHorizontal") == -1.0f))
                {
                    if (BeforeClossButton[2])
                    {
                        return(true);
                    }
                }
            }
        }

        return(false);
    }
 void Interactible_OnSingleClick(CONTROLLER_BUTTON obj)
 {
     //Place Holder for Interact Functionality
     if (obj == InteractButton)
     {
         Debug.Log("Single Click on " + name);
     }
 }
Пример #4
0
 void ControllerCallbacks_OnButtonClickConfirm(CONTROLLER_BUTTON obj)
 {
     //Calling Recenter to make the camera face along the direction of the recenter point
     if (obj == RecenterButton)
     {
         ARCamera.Instance.Recenter();
     }
     Debug.LogError("On button click confirm " + obj);
 }
Пример #5
0
 void MARInteractible_OnButtonPressStart(CONTROLLER_BUTTON obj)
 {
     if (ClickButton == obj)
     {
         if (TargetImage != null)
         {
             TargetImage.color = PressedColor;
         }
     }
 }
    //Grab End/ Rotation End
    void Interactible_OnLongPressEnd(CONTROLLER_BUTTON obj)
    {
        if (obj == RotationButton)
        {
            rotating = false;
        }

        if (obj == GrabButton)
        {
            grabbed = false;
            release();
        }
    }
    //Grab Start / Rotation Start
    void Interactible_OnLongPressStart(CONTROLLER_BUTTON obj)
    {
        if (obj == RotationButton)
        {
            rotating = true;
            controller.ResetControllerOrientation();
        }

        if (obj == GrabButton)
        {
            grabbed        = true;
            releaseDist    = (arCamera.GetHeadTransform().position - transform.position).magnitude;
            pickedRotation = GetRotationBetweenObjectAndCamera(gameObject);
        }
    }
Пример #8
0
    void MARInteractible_OnButtonPressEnd(CONTROLLER_BUTTON obj)
    {
        if (ClickButton == obj)
        {
            if (TargetImage != null)
            {
                TargetImage.color = NormalColor;
            }

            if (OnClick != null)
            {
                OnClick.Invoke();
            }
        }
    }
Пример #9
0
    // 以下コメントなし。

    public bool GetPressButton(CONTROLLER_BUTTON button)
    {
        if (button > CONTROLLER_BUTTON.CLOSS_RIGHT)
        {
            if (Input.GetKey(keyDictionary[button]) || Input.GetKey(padDictionary[button]))
            {
                return(true);
            }
        }
        else
        {
            if (button == CONTROLLER_BUTTON.CLOSS_UP)
            {
                if (Input.GetKey(keyDictionary[button]) || Input.GetAxisRaw("GamePadVertical") == 1.0f)
                {
                    return(true);
                }
            }
            else if (button == CONTROLLER_BUTTON.CLOSS_DOWN)
            {
                if (Input.GetKey(keyDictionary[button]) || Input.GetAxisRaw("GamePadVertical") == -1.0f)
                {
                    return(true);
                }
            }
            else if (button == CONTROLLER_BUTTON.CLOSS_RIGHT)
            {
                if (Input.GetKey(keyDictionary[button]) || Input.GetAxisRaw("GamePadHorizontal") == 1.0f)
                {
                    return(true);
                }
            }
            else
            {
                if (Input.GetKey(keyDictionary[button]) || Input.GetAxisRaw("GamePadHorizontal") == -1.0f)
                {
                    return(true);
                }
            }
        }


        return(false);
    }
 void MARInteractible_OnLongPressEnd(CONTROLLER_BUTTON obj)
 {
     Debug.Log("Long press end on " + gameObject.name);
 }
Пример #11
0
 void ControllerCallbacks_OnButtonLongPressStart(CONTROLLER_BUTTON obj)
 {
     Debug.LogError("Long Press Start " + obj);
 }
Пример #12
0
 void ControllerCallbacks_OnButtonDoubleClick(CONTROLLER_BUTTON obj)
 {
     Debug.LogError("Double click " + obj);
 }
 void MARInteractible_OnDoubleClick(CONTROLLER_BUTTON obj)
 {
     Debug.Log("Double Click on " + gameObject.name);
 }
 void MARInteractible_OnSingleClickConfirm(CONTROLLER_BUTTON obj)
 {
     Debug.Log("Single Click Confirm " + obj + " on " + gameObject.name);
 }
 void MARInteractible_OnSingleClickUp(CONTROLLER_BUTTON obj)
 {
     Debug.Log("Single Click " + obj + " up on " + gameObject.name);
 }
 void MARInteractible_OnButtonPressStart(CONTROLLER_BUTTON obj)
 {
     Debug.Log("Button " + obj + " press has started while gazing on " + gameObject.name);
 }
Пример #17
0
 void ControllerCallbacks_OnButtonClickUp(CONTROLLER_BUTTON obj)
 {
     Debug.LogError("On button click up " + obj);
 }
Пример #18
0
    public void ControllerRequest(CONTROLLER_BUTTON _buttonPressed)
    {
        // If player is trying to move
        if (_buttonPressed == CONTROLLER_BUTTON.JOY_STICK_LEFT)
        {
            currentState.Move();
        }

        // If player is trying to look around
        if (_buttonPressed == CONTROLLER_BUTTON.JOY_STICK_RIGHT)
        {
            RotateCharacter();
        }

        // If player is pressing a button
        else
        {
            switch (_buttonPressed)
            {
            case CONTROLLER_BUTTON.BOTTOM_FACE:
                if (currentState == availableStates[1])
                {
                    if (DashAvailability())
                    {
                        // Change character state to dashing
                        ChangeCharacterStates(2);
                    }
                }
                break;

            case CONTROLLER_BUTTON.DPAD_LEFT:
                break;

            case CONTROLLER_BUTTON.DPAD_UP:
                break;

            case CONTROLLER_BUTTON.DPAD_RIGHT:
                break;

            case CONTROLLER_BUTTON.DPAD_DOWN:
                break;

            case CONTROLLER_BUTTON.L1B:
                break;

            case CONTROLLER_BUTTON.L2T:
                PullTrigger(0);
                break;

            case CONTROLLER_BUTTON.L3:
                break;

            case CONTROLLER_BUTTON.LEFT_FACE:
                ReloadWeapon(0);
                break;

            case CONTROLLER_BUTTON.OPTIONS:
                break;

            case CONTROLLER_BUTTON.R1B:
                break;

            case CONTROLLER_BUTTON.R2T:
                PullTrigger(1);
                break;

            case CONTROLLER_BUTTON.R3:
                ToggleZoom();
                break;

            case CONTROLLER_BUTTON.RIGHT_FACE:
                ReloadWeapon(1);
                break;

            case CONTROLLER_BUTTON.SHARE:
                break;

            case CONTROLLER_BUTTON.TOP_FACE:
                UseBomb();
                break;

            case CONTROLLER_BUTTON.TOUCH_PAD:
                break;
            }
        }
    }
Пример #19
0
/******************************************************
 * Function: GetButton
 * Parameters: 
 *		whichPlayer - Players ONE through FOUR
 *		whichButton - A, B, X, Y, Bumper L, Bumper R,
 *			Leftstick Click, Rightstick Click, Start,
 *			Back
 *		whichState - Up or Down
 * Return:
 *		Returns true or false for the desired state of
 *		the desired button of the desired player
 *	*NOTE* - Any advancement of menus should use A for
 *		confirm and B for cancel as Start and Back are
 *		not Android friendly
******************************************************/
	public static bool GetButton(PLAYER_NUMBER whichPlayer, CONTROLLER_BUTTON whichButton, BUTTON_STATE whichState)
	{
		bool buttonValue = false;

		string inputToCheck = "P" + ((int)whichPlayer).ToString() + "_";

		switch (whichButton)
		{
			case CONTROLLER_BUTTON.A:
				inputToCheck += "Button_A";
				break;
			case CONTROLLER_BUTTON.B:
				inputToCheck += "Button_B";
				break;
			case CONTROLLER_BUTTON.X:
				inputToCheck += "Button_X";
				break;
			case CONTROLLER_BUTTON.Y:
				inputToCheck += "Button_Y";
				break;
			case CONTROLLER_BUTTON.BUMPER_L:
				inputToCheck += "Bumper_L";
				break;
			case CONTROLLER_BUTTON.BUMPER_R:
				inputToCheck += "Bumper_R";
				break;
			case CONTROLLER_BUTTON.START:
				inputToCheck += "Start";
				break;
			case CONTROLLER_BUTTON.BACK:
				inputToCheck += "Back";
				break;
			case CONTROLLER_BUTTON.LEFTSTICK_CLICK:
				inputToCheck += "LeftStick_Click";
				break;
			case CONTROLLER_BUTTON.RIGHTSTICK_CLICK:
				inputToCheck += "RightStick_Click";
				break;
			default:
				break;
		}

		if (whichState == BUTTON_STATE.DOWN)
			buttonValue = Input.GetButtonDown(inputToCheck);
		else if (whichState == BUTTON_STATE.UP)
			buttonValue = Input.GetButtonUp(inputToCheck);
		else if (whichState == BUTTON_STATE.HELD)
			buttonValue = Input.GetButton(inputToCheck);

		return buttonValue;

	}
 void MARInteractible_OnLongPressStart(CONTROLLER_BUTTON obj)
 {
     Debug.Log("Long Press Start on " + gameObject.name);
 }