Skip to content

Instantly share code, notes, and snippets.

View ababilinski's full-sized avatar
🤠

Adrian Babilinski ababilinski

🤠
View GitHub Profile
@ababilinski
ababilinski / SingletonScriptableObject.cs
Last active March 17, 2021 16:16
Abstract class for making reload-proof singletons out of Uniy3D ScriptableObjects
using System.Linq;
using UnityEngine;
/// <summary>
/// Abstract class for making reload-proof singletons out of ScriptableObjects
/// Returns the asset created on editor, null if there is none
/// Based on https://www.youtube.com/watch?v=VBA1QCoEAX4
/// </summary>
/// <typeparam name="T">Type of the singleton</typeparam>