UnityEngine.Input.GetAxisRaw(string)

Here are the examples of the csharp api class UnityEngine.Input.GetAxisRaw(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

41 Examples 7

1. Example

Project: UnityHello
Source File: UnityEngine_InputWrap.cs
View license
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int GetAxisRaw(IntPtr L)
	{
		try
		{
			ToLua.CheckArgsCount(L, 1);
			string arg0 = ToLua.CheckString(L, 1);
			float o = UnityEngine.Input.GetAxisRaw(arg0);
			LuaDLL.lua_pushnumber(L, o);
			return 1;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}

2. Example

Project: Uniject
Source File: UnityInput.cs
View license
public float GetAxisRaw(string name) { return Input.GetAxisRaw(name); }

3. Example

View license
private Vector2 GetJoystickOffset(Stick whichStick)
        {
            Vector2 move = Vector2.zero;
            if (whichStick == Stick.Left)
            {
                move.x = UnityEngine.Input.GetAxisRaw(this.HorizontalAxis);
                move.y = UnityEngine.Input.GetAxisRaw(this.VerticalAxis);
            }
            else
            {
            }

            return move;
        }

4. Example

View license
void UpdateMovement()
    {
        Vector2 movementVelocity = m_Body.velocity;

        if( Input.GetAxisRaw( "Horizontal" ) > 0.5f )
        {
            movementVelocity.x = Speed;

        }
        else if( Input.GetAxisRaw( "Horizontal" ) < -0.5f )
        {
            movementVelocity.x = -Speed;
        }
        else
        {
            movementVelocity.x = 0;
        }

        m_Body.velocity = movementVelocity;
    }

5. Example

View license
void UpdateMovement()
    {
        Vector2 movementVelocity = m_Body.velocity;

        if( Input.GetAxisRaw( "Horizontal" ) > 0.5f )
        {
            movementVelocity.x = Speed;

        }
        else if( Input.GetAxisRaw( "Horizontal" ) < -0.5f )
        {
            movementVelocity.x = -Speed;
        }
        else
        {
            movementVelocity.x = 0;
        }

        m_Body.velocity = movementVelocity;
    }

6. Example

Project: Memoria
Source File: StandaloneInputModule.cs
View license
private Vector2 GetRawMoveVector()
        {
            Vector2 move = Vector2.zero;
            move.x = Input.GetAxisRaw(m_HorizontalAxis);
            move.y = Input.GetAxisRaw(m_VerticalAxis);

            if (Input.GetButtonDown(m_HorizontalAxis))
            {
                if (move.x < 0)
                    move.x = -1f;
                if (move.x > 0)
                    move.x = 1f;
            }
            if (Input.GetButtonDown(m_VerticalAxis))
            {
                if (move.y < 0)
                    move.y = -1f;
                if (move.y > 0)
                    move.y = 1f;
            }
            return move;
        }

7. Example

Project: unity3d-ui
Source File: StandaloneInputModule.cs
View license
private Vector2 GetRawMoveVector()
        {
            Vector2 move = Vector2.zero;
            move.x = Input.GetAxisRaw(m_HorizontalAxis);
            move.y = Input.GetAxisRaw(m_VerticalAxis);

            if (Input.GetButtonDown(m_HorizontalAxis))
            {
                if (move.x < 0)
                    move.x = -1f;
                if (move.x > 0)
                    move.x = 1f;
            }
            if (Input.GetButtonDown(m_VerticalAxis))
            {
                if (move.y < 0)
                    move.y = -1f;
                if (move.y > 0)
                    move.y = 1f;
            }
            return move;
        }

8. Example

Project: sdsandbox
Source File: StandaloneInput.cs
View license
public override float GetAxis(string name, bool raw)
        {
            return raw ? Input.GetAxisRaw(name) : Input.GetAxis(name);
        }

9. Example

Project: Rotorcross
Source File: StandaloneInput.cs
View license
public override float GetAxis(string name, bool raw)
        {
            return raw ? Input.GetAxisRaw(name) : Input.GetAxis(name);
        }

10. Example

Project: Silphid.Unity
Source File: CustomInputModule.cs
View license
private Vector2 GetRawMoveVector()
        {
            var move = Vector2.zero;
            move.x = Input.GetAxisRaw(m_HorizontalAxis);
            move.y = Input.GetAxisRaw(m_VerticalAxis);

            if (Input.GetButtonDown(m_HorizontalAxis))
            {
                if (move.x < 0)
                    move.x = -1f;
                if (move.x > 0)
                    move.x = 1f;
            }
            if (Input.GetButtonDown(m_VerticalAxis))
            {
                if (move.y < 0)
                    move.y = -1f;
                if (move.y > 0)
                    move.y = 1f;
            }
            return move;
        }

11. Example

Project: gl-bits
Source File: StandaloneInput.cs
View license
public override float GetAxis(string name, bool raw)
        {
            return raw ? Input.GetAxisRaw(name) : Input.GetAxis(name);
        }

12. Example

Project: UWO
Source File: TestController.cs
View license
void Move()
	{
		var velocity = Vector3.zero;
		velocity += Input.GetAxisRaw("Horizontal") * transform.right;
		velocity += Input.GetAxisRaw("Vertical") * transform.forward;
		velocity = velocity.normalized * moveSpeed;
		if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)) {
			velocity *= 1.5f;
		}
		transform.position += velocity * Time.deltaTime;
	}

13. Example

Project: tango-examples-unity
Source File: RPGMovement.cs
View license
void UpdateBackwardMovement()
    {
        if( Input.GetKey( KeyCode.S ) || Input.GetAxisRaw("Vertical") < -0.1f )
        {
            m_CurrentMovement = -transform.forward * BackwardSpeed;
        }
    }

14. Example

View license
public bool IsMoving()
    {
        return Mathf.Abs(Input.GetAxisRaw("Vertical")) + Mathf.Abs(Input.GetAxisRaw("Horizontal")) > 0.5f;
    }

15. Example

View license
public bool IsMoving()
    {
        return Mathf.Abs(Input.GetAxisRaw("Vertical")) + Mathf.Abs(Input.GetAxisRaw("Horizontal")) > 0.5f;
    }

16. Example

Project: tango-examples-unity
Source File: RPGMovement.cs
View license
void UpdateForwardMovement()
    {
        if( Input.GetKey( KeyCode.W ) || Input.GetAxisRaw("Vertical") > 0.1f )
        {
            m_CurrentMovement = transform.forward * ForwardSpeed;
        }
    }

17. Example

Project: Memoria
Source File: BattleHUD.Unity.cs
View license
private void UpdateAndroidTV()
    {
        HonoInputManager instance = PersistenSingleton<HonoInputManager>.Instance;
        if (!FF9StateSystem.AndroidTVPlatform || !instance.IsControllerConnect || !FF9StateSystem.EnableAndroidTVJoystickMode)
            return;
        Single axisRaw = Input.GetAxisRaw(instance.SpecificPlatformRightTriggerKey);
        Boolean button = Input.GetButton(instance.DefaultJoystickInputKeys[2]);
        Boolean flag = axisRaw > 0.189999997615814 && button;
        if (flag && _lastFrameRightTriggerAxis > 0.189999997615814 && _lastFramePressOnMenu)
            flag = false;
        if (flag && !_hidingHud)
            ProcessAutoBattleInput();
        _lastFrameRightTriggerAxis = axisRaw;
        _lastFramePressOnMenu = button;
    }

18. Example

View license
public bool IsMoving()
    {
        return Mathf.Abs(Input.GetAxisRaw("Vertical")) + Mathf.Abs(Input.GetAxisRaw("Horizontal")) > 0.5f;
    }

19. Example

Project: Memoria
Source File: Input.cs
View license
public static Single GetAxisRaw(String axisName)
        {
            Single axisRaw = UnityEngine.Input.GetAxisRaw(axisName);
            if ((Double)axisRaw != 0.0)
                return axisRaw;
            return Input.GetXAxis(axisName);
        }

20. Example

Project: CubeWorld
Source File: PlayerControllerUnity.cs
View license
private void UpdateMovement()
    {
        float h = Input.GetAxisRaw("Horizontal");
        float v = Input.GetAxisRaw("Vertical");

        Vector3 dirWalk = transform.forward * v;
        Vector3 dirStrafe = transform.right * h;
        Vector3 dir = dirWalk + dirStrafe;
        dir.y = 0;
        dir.Normalize();

        playerUnity.player.input.moveDirection = GraphicsUnity.Vector3ToCubeWorldVector3(dir);
    }

21. Example

Project: Yugioh-For-HoloLens
Source File: RPGMovement.cs
View license
void UpdateForwardMovement()
    {
        if( Input.GetKey( KeyCode.W ) || Input.GetAxisRaw("Vertical") > 0.1f )
        {
            m_CurrentMovement = transform.forward * ForwardSpeed;
        }
    }

22. Example

Project: Yugioh-For-HoloLens
Source File: RPGMovement.cs
View license
void UpdateBackwardMovement()
    {
        if( Input.GetKey( KeyCode.S ) || Input.GetAxisRaw("Vertical") < -0.1f )
        {
            m_CurrentMovement = -transform.forward * BackwardSpeed;
        }
    }

23. Example

View license
public bool IsMoving()
    {
        return Mathf.Abs(Input.GetAxisRaw("Vertical")) + Mathf.Abs(Input.GetAxisRaw("Horizontal")) > 0.5f;
    }

24. Example

Project: tango-examples-unity
Source File: RPGMovement.cs
View license
void UpdateRotateMovement()
    {
        if( Input.GetKey( KeyCode.A ) || Input.GetAxisRaw("Horizontal") < -0.1f )
        {
            m_CurrentTurnSpeed = -RotateSpeed;
            transform.Rotate(0.0f, -RotateSpeed * Time.deltaTime, 0.0f);
        }

        if( Input.GetKey( KeyCode.D ) || Input.GetAxisRaw("Horizontal") > 0.1f )
        {
            m_CurrentTurnSpeed = RotateSpeed;
            transform.Rotate(0.0f, RotateSpeed * Time.deltaTime, 0.0f);
        }
    }

25. Example

Project: Memoria
Source File: VirtualAnalog.cs
View license
public Vector2 GetAxesRawInst()
	{
		Single y;
		Single x;
		if (this.HasInputInst())
		{
			Vector2 analogValueInst = this.GetAnalogValueInst();
			y = analogValueInst.y;
			x = analogValueInst.x;
		}
		else
		{
			y = Input.GetAxisRaw("Vertical");
			x = Input.GetAxisRaw("Horizontal");
		}
		return new Vector2(x, y);
	}

26. Example

Project: Yugioh-For-HoloLens
Source File: RPGMovement.cs
View license
void UpdateRotateMovement()
    {
        if( Input.GetKey( KeyCode.A ) || Input.GetAxisRaw("Horizontal") < -0.1f )
        {
            m_CurrentTurnSpeed = -RotateSpeed;
            transform.Rotate(0.0f, -RotateSpeed * Time.deltaTime, 0.0f);
        }

        if( Input.GetKey( KeyCode.D ) || Input.GetAxisRaw("Horizontal") > 0.1f )
        {
            m_CurrentTurnSpeed = RotateSpeed;
            transform.Rotate(0.0f, RotateSpeed * Time.deltaTime, 0.0f);
        }
    }

27. Example

Project: tango-examples-unity
Source File: MoveByKeys.cs
View license
public void FixedUpdate()
    {
        if (!photonView.isMine)
        {
            return;
      /n ..... /n //View Source file for more details /n }

28. Example

View license
public override bool ShouldActivate()
        {
            bool shouldActivate = false;

            shouldActivate |= UnityEngine.Input.GetButtonDown(this.SubmitButton);
            shouldActivate |= this.UseKeyboard && UnityEngine.Input.GetKeyDown(this.SubmitKey);
            shouldActivate |= UnityEngine.Input.GetButtonDown(this.CancelButton);
            shouldActivate |= this.UseKeyboard && UnityEngine.Input.GetKeyDown(this.CancelKey);
            shouldActivate |= !Mathf.Approximately(UnityEngine.Input.GetAxisRaw(this.HorizontalAxis), 0.0f);
            shouldActivate |= !Mathf.Approximately(UnityEngine.Input.GetAxisRaw(this.VerticalAxis), 0.0f);

            return shouldActivate;
        }

29. Example

Project: Yugioh-For-HoloLens
Source File: MoveByKeys.cs
View license
public void FixedUpdate()
    {
        if (!photonView.isMine)
        {
            return;
      /n ..... /n //View Source file for more details /n }

30. Example

Project: synthesis
Source File: InputControl.cs
View license
public static float GetAxisRaw(string axisName, bool exactKeyModifiers = false)
    {
        float sensitivity = 1f;

        #region Standard axes
        if (axisName.Equals("Mouse X"))
        {
            sensitivity = mMouseSensitivity;
        }
        else
        if (axisName.Equals("Mouse Y"))
        {
            if (mInvertMouseY)
            {
                sensitivity = -mMouseSensitivity;
            }
            else
            {
                sensitivity = mMouseSensitivity;
            }
        }
        #endregion

        Axis outAxis = null;

        if (!mAxesMap.TryGetValue(axisName, out outAxis))
        {
            if (
                !axisName.Equals("Mouse X")
                &&
                !axisName.Equals("Mouse Y")
                &&
                !axisName.Equals("Mouse ScrollWheel")
               )
            {
                Debug.LogError("Axis \"" + axisName + "\" not found. Using InputManager axis");
            }

            return Input.GetAxisRaw(axisName) * sensitivity;
        }

        return outAxis.getValue(exactKeyModifiers, mInputDevice) * sensitivity;
    }

31. Example

Project: Silphid.Unity
Source File: CustomInputModule.cs
View license
public override bool ShouldActivateModule()
        {
            if (!base.ShouldActivateModule())
                return false;

            var shouldActivate = m_ForceModuleActive;
            Input.GetButtonDown(m_SubmitButton);
            shouldActivate |= Input.GetButtonDown(m_CancelButton);
            shouldActivate |= !Mathf.Approximately(Input.GetAxisRaw(m_HorizontalAxis), 0.0f);
            shouldActivate |= !Mathf.Approximately(Input.GetAxisRaw(m_VerticalAxis), 0.0f);
            shouldActivate |= (m_MousePosition - m_LastMousePosition).sqrMagnitude > 0.0f;
            shouldActivate |= Input.GetMouseButtonDown(0);
            return shouldActivate;
        }

32. Example

Project: Memoria
Source File: StandaloneInputModule.cs
View license
public override bool ShouldActivateModule()
        {
            if (!base.ShouldActivateModule())
                return false;

            var shouldActivate = m_ForceModuleActive;
            Input.GetButtonDown(m_SubmitButton);
            shouldActivate |= Input.GetButtonDown(m_CancelButton);
            shouldActivate |= !Mathf.Approximately(Input.GetAxisRaw(m_HorizontalAxis), 0.0f);
            shouldActivate |= !Mathf.Approximately(Input.GetAxisRaw(m_VerticalAxis), 0.0f);
            shouldActivate |= (m_MousePosition - m_LastMousePosition).sqrMagnitude > 0.0f;
            shouldActivate |= Input.GetMouseButtonDown(0);
            return shouldActivate;
        }

33. Example

Project: unity3d-ui
Source File: StandaloneInputModule.cs
View license
public override bool ShouldActivateModule()
        {
            if (!base.ShouldActivateModule())
                return false;

            var shouldActivate = Input.GetButtonDown(m_SubmitButton);
            shouldActivate |= Input.GetButtonDown(m_CancelButton);
            shouldActivate |= !Mathf.Approximately(Input.GetAxisRaw(m_HorizontalAxis), 0.0f);
            shouldActivate |= !Mathf.Approximately(Input.GetAxisRaw(m_VerticalAxis), 0.0f);
            shouldActivate |= (m_MousePosition - m_LastMousePosition).sqrMagnitude > 0.0f;
            shouldActivate |= Input.GetMouseButtonDown(0);
            return shouldActivate;
        }

34. Example

View license
private void Update()
        {
            // If it's not the player's turn, exit the function.
   /n ..... /n //View Source file for more details /n }

35. Example

Project: Rotorcross
Source File: SideScroller.cs
View license
void Update(){

		cam.transform.LookAt(anchor);

		AnchorMovement();

		float mouseInput = Input.GetAxisRaw("Mouse ScrollWheel") * sensitivity;
		int status;

		if (mouseInput > 0)
			status = 1;
		else if (mouseInput < 0)
			status = 2;
		else
			status = 3;

		cam.transform.position = Vector3.Lerp(cam.transform.position, target (status), Time.fixedDeltaTime * 5);

	}

36. Example

Project: Unity3D-DXF-Viewer
Source File: GoView.cs
View license
void Update()
    {
        //??????
        float delta = Input.GetAxisRaw("Mouse ScrollWheel");
        if (delta != 0)
        {
            isUdelta = true;

            camera.orthographicSize -= delta * (camera.orthographicSize);

            //??????
            Zoom = (camera.orthographicSize / 150);

            if (delta > 0)
                ResizeObjects.ForEach((l) => { if (l.gameObject.activeSelf == false) l.ToMax(); });
            else
                ResizeObjects.ForEach((l) => { if (l.gameObject.activeSelf == true)  l.ToMin(); });
            ResizeObjects.ForEach((l) =>
            {
                if (l.gameObject.activeSelf)
                    l.SetSetWidth();
            });

            isUdelta = false;
        }

        //??????
        if (Input.GetMouseButton(2) && isUdelta == false)
        {
            camera.transform.Translate(camera.transform.right * -Input.GetAxis("Mouse X") * (camera.orthographicSize / 2) * 0.2f, Space.World);
            camera.transform.Translate(camera.transform.up * -Input.GetAxis("Mouse Y") * (camera.orthographicSize / 2) * 0.2f, Space.World);
        }
    }

37. Example

View license
void UpdateSmoothedMovementDirection()
    {
        Transform cameraTransform = Camera.main.transfo/n ..... /n //View Source file for more details /n }

38. Example

Project: Memoria
Source File: HonoInputManager.cs
View license
private void ScanKeySources()
    {
        this.ResetSources();
        if (this.isDisablePrimaryKe/n ..... /n //View Source file for more details /n }

39. Example

View license
void UpdateSmoothedMovementDirection()
    {
        Transform cameraTransform = Camera.main.transfo/n ..... /n //View Source file for more details /n }

40. Example

View license
void UpdateSmoothedMovementDirection()
    {
        Transform cameraTransform = Camera.main.transfo/n ..... /n //View Source file for more details /n }

41. Example

View license
void UpdateSmoothedMovementDirection()
    {
        Transform cameraTransform = Camera.main.transfo/n ..... /n //View Source file for more details /n }