Skip to content

Instantly share code, notes, and snippets.

@kleberandrade
Created September 4, 2019 20:15
Show Gist options
  • Save kleberandrade/a8381664bf2a46b14233b2b7e2302e6f to your computer and use it in GitHub Desktop.
Save kleberandrade/a8381664bf2a46b14233b2b7e2302e6f to your computer and use it in GitHub Desktop.
using UnityEngine;
public class Detonator : MonoBehaviour
{
public Explosion m_ExplosionScript;
private void Update()
{
if (Input.GetButtonDown("Fire1"))
{
m_ExplosionScript.Explode();
CameraShake.Instance.ShakeOnce(1.0f, 30.0f);
Destroy(gameObject);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment