Files
Cielonos/Assets/Scripts/MainGame/Base/SubcontrollerBase.cs
SoulliesOfficial 649b7a5ddc 更新
2026-05-23 08:27:50 -04:00

25 lines
547 B
C#

using System;
using Sirenix.OdinInspector;
using UnityEngine;
namespace Cielonos.MainGame
{
public class SubcontrollerBase<T> : SerializedMonoBehaviour where T : MonoBehaviour
{
[HideInEditorMode]
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
}
}