22 lines
457 B
C#
22 lines
457 B
C#
// Don't forget to add this.
|
|
using CameraShake;
|
|
using UnityEngine;
|
|
using UnityEngine.InputSystem;
|
|
|
|
public class ExplosionTrigger : MonoBehaviour
|
|
{
|
|
|
|
private void Update()
|
|
{
|
|
if (Mouse.current.rightButton.wasPressedThisFrame)
|
|
|
|
//if (Input.GetKeyDown(KeyCode.Mouse0))
|
|
{
|
|
FindObjectOfType<Explosion>().Explode();
|
|
|
|
// Shaking the camera.
|
|
CameraShaker.Presets.ShortShake2D();
|
|
}
|
|
}
|
|
}
|