mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-24 00:58:59 -05:00
e5f6659eda
* Removed unused namespaces across all files in Unity.Atoms assembly. * Removed unused namspaces in runtime and Test assembly code.
28 lines
694 B
C#
28 lines
694 B
C#
using UnityEngine;
|
|
|
|
namespace UnityAtoms
|
|
{
|
|
public class MonoHook<E1, E2, EV, SF> : MonoBehaviour
|
|
where E1 : GameEvent<EV> where E2 : GameEvent<EV, GameObject>
|
|
where SF : GameFunction<GameObject, GameObject>
|
|
{
|
|
public E1 Event;
|
|
|
|
public E2 EventWithGORef;
|
|
|
|
[SerializeField]
|
|
protected SF SelectGORef;
|
|
|
|
protected void OnHook(EV value)
|
|
{
|
|
if (Event != null)
|
|
{
|
|
Event.Raise(value);
|
|
}
|
|
if (EventWithGORef != null)
|
|
{
|
|
EventWithGORef.Raise(value, SelectGORef != null ? SelectGORef.Call(gameObject) : gameObject);
|
|
}
|
|
}
|
|
}
|
|
} |