﻿using UnityEngine;

namespace JasonStorey
{
    public static class DependencyTools
    {
        public static T GetOrCreate<T>(this MonoBehaviour owner) where T : Component
        {
            var existing = owner.GetComponent<T>();
            return existing ? existing : owner.gameObject.AddComponent<T>();
        }
    }
}