// Update is called once per frame void Update() { if (Input.GetButtonDown("Fire2")) { largeBulletCoroutine = StartCoroutine(mycannonfire.Fire(mylargebulletprefab, 0.1f)); } if (Input.GetButtonUp("Fire2")) { StopCoroutine(largeBulletCoroutine); } }
// Update is called once per frame void Update() { Quaternion newrotation = Quaternion.LookRotation(this.transform.position - GameData.MouseTarget, Vector3.forward); newrotation.x = 0f; newrotation.y = 0f; //this.transform.rotation = newrotation; //no slurp this.transform.rotation = Quaternion.Slerp(this.transform.rotation, newrotation, Time.deltaTime * 4); if (Input.GetButtonDown("Fire1")) { smallBulletCoroutine = StartCoroutine(mycannonfire.Fire(mysmallbulletprefab, 0.1f)); } if (Input.GetButtonUp("Fire1")) { StopCoroutine(smallBulletCoroutine); } }