Files
Cielonos/Assets/Scripts/MainGame/Base/SubcontrollerBase.cs
SoulliesOfficial ef7b479712 initial
2025-11-25 08:19:33 -05:00

24 lines
520 B
C#

using System;
using Sirenix.OdinInspector;
using UnityEngine;
namespace Cielonos.MainGame
{
public class SubcontrollerBase<T> : SerializedMonoBehaviour where T : MonoBehaviour
{
public T owner;
public virtual void Initialize()
{
owner ??= GetComponent<T>() ?? GetComponentInParent<T>();
}
#if UNITY_EDITOR
protected virtual void Reset()
{
owner ??= GetComponent<T>() ?? GetComponentInParent<T>();
}
#endif
}
}