So i have this script for rotation my turret in my android game and it works fine on the touchscreen of my android device. I am using the standard assets cross platform scripts attached to my UI buttons and everything works but i want to know how can i and an and statement to my current script so i can make it cross platform and use the Input.GetAxis as well as the cross platform axis?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityStandardAssets.CrossPlatformInput;
public class Aim : MonoBehaviour
{
public float minClamp = -90f;
public float maxClamp = -43f;
public float speed = 5.0f;
private float zRotation = -90f;
void Update()
{
zRotation = Mathf.Clamp(zRotation - CrossPlatformInputManager.GetAxis("Horizontal") * speed, minClamp, maxClamp);
transform.eulerAngles = new Vector3(zRotation, -90f, 0);
}
}