Skip to content

Instantly share code, notes, and snippets.

@unity3dcollege
Created May 5, 2017 23:22
Show Gist options
  • Save unity3dcollege/30428711ba3418c3fbc5d6d3f831484c to your computer and use it in GitHub Desktop.
Save unity3dcollege/30428711ba3418c3fbc5d6d3f831484c to your computer and use it in GitHub Desktop.
using System;
using UnityEngine;
public class Shootable : MonoBehaviour, ITakeShot
{
public static event Action<Shootable, RaycastHit> OnAnyTookShot = (shootable, impactPoint) => { };
public event Action<RaycastHit> OnTookShot = (impactPoint) => { };
public void TakeShot(RaycastHit hit)
{
OnTookShot(hit);
OnAnyTookShot(this, hit);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment