private void Start() { _controller = GetComponent <CharacterController>(); LoadPlayer(); NotifyUI += _playerUIManager.UpdateUI; _inventory.NotifyUI += _playerUIManager.UpdateUI; SetState(_movingState); NotifyUI?.Invoke(); }
public void AddMoney(ulong money) { if (money >= 0) { _money += money; NotifyUI?.Invoke(); } else { throw new System.Exception("money < 0"); } }
public bool TryDecreaseMoney(ulong money) { if (money > 0) { if (_money >= money) { _money -= money; NotifyUI?.Invoke(); return(true); } else { return(false); } } else { throw new System.Exception("money < 0"); } }