2025-11-25 08:19:33 -05:00
|
|
|
using System;
|
|
|
|
|
using Sirenix.OdinInspector;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace Cielonos.MainGame
|
|
|
|
|
{
|
|
|
|
|
public class SubcontrollerBase<T> : SerializedMonoBehaviour where T : MonoBehaviour
|
|
|
|
|
{
|
2026-05-23 08:27:50 -04:00
|
|
|
[HideInEditorMode]
|
2025-11-25 08:19:33 -05:00
|
|
|
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
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|