using System.Collections.Generic; using UnityEngine; public class GameState : MonoBehaviour { // Настройки игрока public string PlayerName { get; set; } public int Health { get; set; } public int Magic { get; set; } public int Level { get; set; } // Управление public bool IsPlayerControlLocked { get; set; } // Сюжетные переменные private Dictionary _storyVariables = new Dictionary(); // Навыки и инвентарь public List Skills { get; set; } = new List(); public Dictionary Inventory { get; set; } = new Dictionary(); public void SetGlobalVariable(int address, int value) { _storyVariables[address] = value; Debug.Log($"Set global variable 0x{address:X8} = {value}"); } public int GetGlobalVariable(int address) { return _storyVariables.TryGetValue(address, out int value) ? value : 0; } public void Reset() { _storyVariables.Clear(); Skills.Clear(); Inventory.Clear(); Health = 100; Magic = 50; Level = 1; IsPlayerControlLocked = true; } }