protected override void DoShoot(DungeonControl2 dungeon, Vector3 from, Vector3 to) { weaponBody.transform.position = to; dungeon.Attack(brush); Instantiate(hitPS.gameObject, to, Quaternion.identity); }
protected override void DoShoot(DungeonControl2 dungeon, Vector3 from, Vector3 to) { this.weaponBody.get_transform().set_position(from); this.weaponBody.get_transform().LookAt(to, Vector3.get_up()); dungeon.Attack(this.brush); Object.Instantiate <GameObject>((M0)((Component)this.hitPS).get_gameObject(), to, Quaternion.get_identity()); Object.Instantiate <GameObject>((M0)((Component)this.shootPS).get_gameObject(), this.weaponBody.get_transform().get_position(), this.weaponBody.get_transform().get_rotation()); }
public void Shoot(DungeonControl2 dungeon, Vector3 from, Vector3 to) { if (Object.op_Inequality((Object)this.audio, (Object)null) && Object.op_Inequality((Object)this.shotAudio, (Object)null)) { this.audio.PlayOneShot(this.shotAudio); } this.DoShoot(dungeon, from, to); }
public void Shoot(DungeonControl2 dungeon, Vector3 from, Vector3 to) { if (audioSource != null && shotAudio != null) { audioSource.PlayOneShot(shotAudio); } DoShoot(dungeon, from, to); }
public void Shoot(DungeonControl2 dungeon, Vector3 from, Vector3 to) { if (GetComponent <AudioSource>() != null && shotAudio != null) { // audio.PlayOneShot(shotAudio); } DoShoot(dungeon, from, to); }
public void Shoot() { RaycastHit raycastHit; if (!Physics.Raycast(this.myCamera.ScreenPointToRay(new Vector3((float)this.myCamera.get_pixelWidth() * 0.5f, (float)this.myCamera.get_pixelHeight() * 0.5f, 0.0f)), ref raycastHit)) { return; } DungeonControl2 componentInParents = Utils.FindComponentInParents <DungeonControl2>(((Component)((RaycastHit) ref raycastHit).get_collider()).get_transform()); if (!Object.op_Inequality((Object)componentInParents, (Object)null)) { return; } this._currentWeapon.Shoot(componentInParents, ((Component)this.myCamera).get_transform().get_position(), ((RaycastHit) ref raycastHit).get_point()); }
public void Shoot() { Ray ray = myCamera.ScreenPointToRay(new Vector3(myCamera.pixelWidth * 0.5f, myCamera.pixelHeight * 0.5f, 0.0f)); // ray.origin = ray.origin + ray.direction; RaycastHit hitInfo; if (Physics.Raycast(ray, out hitInfo)) { Transform target = hitInfo.collider.transform; DungeonControl2 dungeon = Utils.FindComponentInParents <DungeonControl2>(target); if (dungeon != null) { _currentWeapon.Shoot(dungeon, myCamera.transform.position, hitInfo.point); } } }
protected abstract void DoShoot(DungeonControl2 dungeon, Vector3 from, Vector3 to);