using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class GameManager : MonoBehaviour { #region Singleton public static GameManager Instance { get; private set; } #endregion public Dictionary healthContainer; public Dictionary coinContainer; public Dictionary buffReceiverContainer; public Dictionary itemsContainer; [HideInInspector] public PlayerInventory inventory; public ItemBase ItemBase; private void Awake() { Instance = this; healthContainer = new Dictionary(); coinContainer = new Dictionary(); buffReceiverContainer = new Dictionary(); itemsContainer = new Dictionary(); } //Вариант создания пула объектов // private void Start() { // var healthObjects = FindObjectsOfType(); // foreach (var health in healthObjects) { // healthContainer.Add(health.gameObject, health); // } // } }