protected override void Attack() { GameObject proj = Instantiate(projectile, this.transform.position, this.transform.rotation) as GameObject; AbstractProjectileScript proscript = proj.GetComponent <AbstractProjectileScript>(); proscript.setTrackDelaysAndStart(new float[] { spikeTravelTime }); }
void Attack() { if (playerHealth.currentHealth > 0) { audioSource.PlayOneShot(fireSound, .5f); Vector3 upabit = transform.TransformDirection(Vector3.up); Vector3 rothelper = upabit; if (attackCounter % deltas.Length == 0) { rothelper += transform.TransformDirection(Vector3.right) / 3f; } else if (attackCounter % 3 == 1) { //do nothing, directly up } else { rothelper += transform.TransformDirection(Vector3.left) / 3f; } Quaternion pRot = Quaternion.LookRotation(rothelper); GameObject pro; pro = Instantiate(projectile, this.transform.position + upabit, pRot) as GameObject; AbstractProjectileScript proscript = pro.GetComponent <AbstractProjectileScript>(); proscript.setTrackDelaysAndStart(projectileDeltas); anim.SetTrigger("Fire"); attackCounter++; } }
protected override void Attack() { audioSource.Play(); Vector3 upabit = Vector3.up; this.transform.TransformDirection(upabit); upabit *= 1.3f; GameObject projectileinstance = Instantiate(projectile, this.transform.position + upabit, this.transform.rotation) as GameObject; AbstractProjectileScript b = projectileinstance.GetComponent <AbstractProjectileScript> (); b.setTrackDelaysAndStart(new float[] { beatsTilDetonation }); anim.SetTrigger("Fire"); }