Skip to content

Instantly share code, notes, and snippets.

View dnovacik's full-sized avatar
💭
^__^

Daniel Nováčik dnovacik

💭
^__^
  • Slovakia
View GitHub Profile
@dnovacik
dnovacik / SingletonPattern.cs
Last active September 18, 2022 19:11
Singleton for MonoBehaviour
public abstract class SingletonPattern<T> : MonoBehaviour where T : SingletonPattern<T>
{
public static T Instance;
protected virtual void Awake()
{
if (Instance != null)
{
Destroy(this);
}
@dnovacik
dnovacik / EventBroker.cs
Created December 28, 2021 22:47
EventBroker
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Assets.Scripts.Events
{
public static class EventBroker
{