private void Player_OnResourcesChanged(object sender, EventArgs e) { if (unavailableMask != null) { unavailableMask.SetActive(!action.IsAvailable(worldObject.player)); } }
public void Setup(WorldObjectAction _action, WorldObject _worldObject) { if (_action != null) { action = _action; worldObject = _worldObject; worldObject.player.OnResourcesChanged += Player_OnResourcesChanged; if (actionImage != null) { actionImage.sprite = action.actionSprite; } if (unavailableMask != null) { unavailableMask.SetActive(!action.IsAvailable(worldObject.player)); } } }