PJ/Assets/scripts/dotfs_scripts/MANAGER_WindowsBase.cs

31 lines
No EOL
1.2 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using UnityEngine;
public class MANAGER_WindowsBase : MonoBehaviour
{
public static MANAGER_WindowsBase Instance { get; private set; }
[Header("Core Systems")]
public MANAGER_Mail MailSystem;
public MANAGER_QuestProgress QuestSystem;
public MANAGER_RemoteData RemoteData;
public MANAGER_UI UI;
public MANAGER_Shop ShopSystem;
// 1. Делаем Awake доступным для наследников (protected)
// и разрешаем его переопределение (virtual)
protected virtual void Awake()
{
if (Instance == null)
{
Instance = this;
// Убедитесь, что Singleton нужен именно здесь.
// Если это базовый класс для МНОГИХ окон, DontDestroyOnLoad может быть лишним.
DontDestroyOnLoad(gameObject);
}
else if (Instance != this)
{
Destroy(gameObject);
}
}
}