Beispiel #1
0
    public void Activate()
    {
        var mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);

        mousePosition.z = 0;
        beam            = lineCreator.DrawLineTo(mousePosition - transform.position, BeamMaterial, BeamLength, BeamWidth);
        audioManager.PlayMagnet();
    }
Beispiel #2
0
    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();
    }