Kevin_
Kevin_
CC#
Created by Kevin_ on 4/24/2023 in #help
Unity Script Communication
Hi, I was wondering when is a good use case to implement a Singletons and when are they not? I'm currently debating on using one but I've heard really missed opinions on the use of singletons
33 replies
CC#
Created by Kevin_ on 4/23/2023 in #help
❔ Stats
I had a quick question. Is there a way to find a specific scriptable object? I'm working on stats system for a 2D project in Unity but currently when I pickup a stat it adds all of their modifiers regardless if its the right stat or not. I'm using a Event which sends the objectName on pickup to this function
private void HandleObjectAddedToInventory(string objectName)
{
if (objectName == "Health Buff")
{
_playerStats.maxHealth = _modPickUp.mod.modifyAmount;
_playerStats.currentHealth = _playerStats.maxHealth;
}
}
private void HandleObjectAddedToInventory(string objectName)
{
if (objectName == "Health Buff")
{
_playerStats.maxHealth = _modPickUp.mod.modifyAmount;
_playerStats.currentHealth = _playerStats.maxHealth;
}
}
19 replies