// constructor public Health(Health_SO data, bool isFreezable) { _healthData = data; _currentHealth = _healthData.maxHealth; if (isFreezable) { Freezer.trigger += Freeze; } }
// Public // constructor public StaticHealth(Health_SO data, string gameObjectName, bool isFreezable) { _gameObjectName = gameObjectName; _healthData = data; _currentHealth = _healthData.maxHealth; if (isFreezable) { Freezer.trigger += Freeze; } }