Первый коммит с LFS.
This commit is contained in:
1 parent
4fcb1e2f24
commit
179816dc4b
5084 files changed
+3714098
-1
No files matched your search
@@ -0,0 +1,27 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class InteractionHandler : MonoBehaviour
|
||||
{
|
||||
public static InteractionHandler Instance { get; private set; }
|
||||
|
||||
public delegate void OnObjectInteracted(GameObject interactedObject);
|
||||
public event OnObjectInteracted onObjectInteracted;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (Instance == null)
|
||||
{
|
||||
Instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
public void NotifyInteraction(GameObject interactedObject)
|
||||
{
|
||||
onObjectInteracted?.Invoke(interactedObject);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user