public void Activate() { var mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition); mousePosition.z = 0; beam = lineCreator.DrawLineTo(mousePosition - transform.position, BeamMaterial, BeamLength, BeamWidth); audioManager.PlayMagnet(); }
public void Shoot() { var laser = lineCreator.DrawLineTo(transform.up, LaserMaterial, LaserLength, LaserWidth); Destroy(laser, LaserLifeSpan); rigidbody.AddForce(transform.up * -1 * LaserRecoil, ForceMode2D.Impulse); DestroyAsteroidsInDirectionOf(transform.up); gameObject.GetComponent <AudioSourceManager>().PlayLaser(); }