Skip to content

Instantly share code, notes, and snippets.

View OwenMagelssen's full-sized avatar

Owen Magelssen OwenMagelssen

View GitHub Profile
@OwenMagelssen
OwenMagelssen / CursorRaycaster.cs
Last active July 3, 2022 17:05
Provides missing functionality from Unity's new input system for MonoBehaviour.OnMouseDown/Drag/Enter/Exit/Over/Up/UpButton events
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.Events;
public class CursorRaycaster : MonoBehaviour
{
public UnityEvent onClickNothing;
private const float DragThreshold = 1.0f;
private Ray ray;
@OwenMagelssen
OwenMagelssen / SystemsLoader.cs
Last active July 10, 2022 02:44
System initializer for Unity taken from Tarodev (https://www.youtube.com/watch?v=zJOxWmVveXU)
using UnityEngine;
public static class SystemsLoader
{
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
public static void Execute()
{
var systems = Resources.Load("Systems");
if (!systems)