// Update is called once per frame void Update() { float xRot = 0f; float yRot = 0f; float zRot = 0f; if (Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.WindowsPlayer) { yRot = CrossPlatformInputManager.GetAxis("Mouse Y") * XSensitivity; zRot = CrossPlatformInputManager.GetAxis("Vertical") * XSensitivity; xRot = CrossPlatformInputManager.GetAxis("Horizontal") * YSensitivity; } else if (Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.OSXPlayer && controllerAttached) { yRot = CrossPlatformInputManager.GetAxis("Mouse Y") * XSensitivity; zRot = CrossPlatformInputManager.GetAxis("Vertical") * XSensitivity; xRot = CrossPlatformInputManager.GetAxis("Horizontal") * YSensitivity; } if (transform.localPosition.y > -5f) { transform.localPosition += new Vector3(xRot, -5f, zRot); } else { transform.localPosition += new Vector3(xRot, yRot, zRot); } if (platformID == 1) { shootTrigger = Input.GetAxis("Shoot"); } else { shootTrigger = Input.GetAxis("ShootMac"); } //Debug.Log(Mathf.Abs(shootTrigger)); if (Mathf.Abs(shootTrigger) < 0.1f) { shootUp = true; // StartCoroutine("DontShoot"); } if (Input.GetMouseButtonDown(0) || (shootUp && (Mathf.Abs(shootTrigger) > 0.5f))) { GameObject sphere = Instantiate(politicalSphere, new Vector3(transform.position.x, 118.3f, transform.position.z), Quaternion.identity) as GameObject; sphere.transform.parent = ephemeral.transform; GameObject proj = Instantiate(projectors, new Vector3(transform.position.x, 191f, transform.position.z), Quaternion.identity) as GameObject; proj.transform.parent = ephemeral.transform; shootUp = false; economyManager.DecreasePublicFunds(); economyManager.UpdatePublicFunds(); StartCoroutine("SwitchRole"); } }