public virtual void FireP(Vector3 LaunchPos, Quaternion forward, GameObject player = null) { if (Time.time - lastFire >= timeBetweenFire) { if (Aus) { if (!Aus.isPlaying) { Aus.clip = sound; Aus.PlayOneShot(sound); } } lastFire = Time.time; GameObject p = Instantiate(proyectil, LaunchPos, Quaternion.identity); p.transform.rotation = forward; Proyectil pp = p.GetComponent <Proyectil>(); pp.owner = tipo; if (MuzzelVFX) { var f = Instantiate(MuzzelVFX, LaunchPos, forward); Destroy(f, 0.4f); } pp.init(player); pp.Fire(); } }
IEnumerator Launch(GameObject x, GameObject player) { yield return(new WaitForSeconds(Random.Range(0.2f, 0.9f))); GameObject p = Instantiate(proyectil, x.transform.position, Quaternion.identity); p.transform.rotation = x.transform.rotation; Proyectil pp = p.GetComponent <Proyectil>(); pp.owner = tipo; pp.init(player); pp.Fire(); }
public override void FireP(Vector3 LaunchPos, Quaternion forward, GameObject player = null) { if (Time.time - lastFire >= timeBetweenFire) { lastFire = Time.time; GameObject p = Instantiate(proyectil, LaunchPos, Quaternion.identity); p.transform.rotation = forward; Proyectil pp = p.GetComponent <Proyectil>(); pp.owner = tipo; pp.init(player); pp.Fire(); } }