// Update is called once per frame void Update() { if (InputManager.GetButton(shootButtonName) && breakTime <= 0) { Fire(); breakTime = breakBetweenShots; } breakTime = (breakTime <= 0) ? 0 : breakTime - Time.deltaTime; }
// Update is called once per frame void Update() { if (!isLocalPlayer) { return; } float hMove = USACPI.GetAxis("Horizontal") * hSpeed; float vMove = USACPI.GetAxis("Vertical") * vSpeed; transform.Translate(new Vector3(hMove, 0f, vMove)); }
void VerticalRotation() { float rotationFactor = InputManager.GetAxis(verticalAxisName); rotationFactor *= Time.deltaTime * rotationSpeed; float angle = (cameraHolder.transform.rotation.eulerAngles.x - rotationFactor) % 360; if (IsAngleInRange(angle)) { cameraHolder.transform.Rotate(Vector3.left, rotationFactor, Space.Self); } }
public void RegisterVirtualAxis(CrossPlatformInputManager.VirtualAxis axis) { // check if we already have an axis with that name and log and error if we do if (m_VirtualAxes.ContainsKey(axis.name)) { Debug.LogError("There is already a virtual axis named " + axis.name + " registered."); //remove old axis of exist m_VirtualAxes[axis.name].Remove(); } // add any new axes m_VirtualAxes.Add(axis.name, axis); // if we dont want to match with the input manager setting then revert to always using virtual if (!axis.matchWithInputManager) { m_AlwaysUseVirtual.Add(axis.name); } }
public void RegisterVirtualButton(CrossPlatformInputManager.VirtualButton button) { // check if already have a buttin with that name and log an error if we do if (m_VirtualButtons.ContainsKey(button.name)) { Debug.LogError("There is already a virtual button named " + button.name + " registered."); } else { // add any new buttons m_VirtualButtons.Add(button.name, button); // if we dont want to match to the input manager then always use a virtual axis if (!button.matchWithInputManager) { m_AlwaysUseVirtual.Add(button.name); } } }
void Update() { float rotationH = InputManager.GetAxis("Mouse X"); float rotationV = InputManager.GetAxis("Mouse Y"); rotationV = Mathf.Clamp(-rotationV * RotationSensitivity, -80 - verticalRotation, 80 - verticalRotation); verticalRotation += rotationV; Camera.main.transform.Rotate(new Vector3(0, rotationH * RotationSensitivity, 0), Space.World); Camera.main.transform.Rotate(new Vector3(rotationV, 0, 0)); float forwardSpeed = InputManager.GetAxis("Vertical"); float sideWaySpeed = InputManager.GetAxis("Horizontal"); Vector3 speed = new Vector3(sideWaySpeed, 0, forwardSpeed) * WalkSpeed; Camera.main.transform.Translate(speed); float elevation = InputManager.GetAxis("Elevation"); Camera.main.transform.Translate(new Vector3(0, elevation, 0) * WalkSpeed, Space.World); }
public void SetDownState() { print("down registered"); CrossPlatformInputManager.SetButtonDown(Name); }
void HorizontalRotation() { transform.Rotate(Vector3.up, Time.deltaTime * rotationSpeed * InputManager.GetAxis(horizontalAxisName)); }
public override void OnPointerDown(PointerEventData data) { CrossPlatformInputManager.SetButtonDown(ButtonName); }
public override void OnPointerUp(PointerEventData data) { CrossPlatformInputManager.SetButtonUp(ButtonName); base.OnPointerUp(data); }
public override void OnEnable() { base.OnEnable(); mVirtualButton = new CrossPlatformInputManager.VirtualButton(ButtonName); CrossPlatformInputManager.RegisterVirtualButton(mVirtualButton); }
public void SetAxisNeutralState() { CrossPlatformInputManager.SetAxisZero(Name); }
private void Update() { xAxis = InputManager.GetAxis(xAxisName); zAxis = InputManager.GetAxis(zAxisName); }
public void SetDownState() { CrossPlatformInputManager.SetButtonDown(Name); }
CrossPlatformInputManager.VirtualAxis m_VerticalVirtualAxis; // Reference to the joystick in the cross platform input void OnEnable() { CrossPlatformInputManager.UnRegisterVirtualAxis(verticalAxisName); // izimenco CrossPlatformInputManager.UnRegisterVirtualAxis(horizontalAxisName); // izimenco CreateVirtualAxes(); }
public void SetUpState() { CrossPlatformInputManager.SetButtonUp(Name); }
//} public void SetUpState() { CrossPlatformInputManager.SetButtonUp(Name); shotButton.color = new Color(1f, 1f, 1f, 0.27f); }
public void SetAxisPositiveState1() { CrossPlatformInputManager.SetAxisPositive(Name); Invoke("SetAxisNeutralState", 0.2f); }
public void SetUpState() { print("Up registered"); CrossPlatformInputManager.SetButtonUp(Name); }
public void HandleInput(float value) { CrossPlatformInputManager.SetAxis(axis, (value * 2f) - 1f); }
public void SetAxisNegativeState() { CrossPlatformInputManager.SetAxisNegative(Name); }
public void SetDownState() { Debug.Log("Button Down"); CrossPlatformInputManager.SetButtonDown(Name); }