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");
     }
 }
Exemple #4
0
        public static void Alert(string msg, NotifyUI.enmType type)
        {
            NotifyUI frm = new NotifyUI();

            frm.showAlert(msg, type);
        }