/// <summary> /// Adds $100 to treasury. /// </summary> //[Command] public void CMDCollectMoney(int teamID) { moneyAudioSource.PlayOneShot(moneyBagClip); myTeamID = teamID; //*Debug.Log($"CMDCollectMoney has been invoked by {teamID}"); var updateTeam = (Teams)teamID; //*Debug.Log($"{updateTeam.ToString()} I'm {teamID} attempting to CMDCollectMoney"); switch (updateTeam) { case Teams.ROBBERS: robberMoneyCount.money += IncrementValue; Debug.Log($"Increased Robbers Money {robberMoneyCount.money}"); MoneyDisplay.Instance().UpdateCopsView(robberMoneyCount.money); break; case Teams.COPS: copsMoneyCount.money += IncrementValue; Debug.Log($"Increased Cops Money {copsMoneyCount.money}"); MoneyDisplay.Instance().UpdateRobbersView(copsMoneyCount.money); break; } }
/// <summary> /// Removes $100 from the treasury when a player is respawned /// </summary> /// <param name="teamID"></param> public void SubtractMoney(int teamID) { //*Debug.Log($"CMDCollectMoney has been invoked by {teamID}"); var updateTeam = (Teams)teamID; //*Debug.Log($"{updateTeam.ToString()} I'm {teamID} attempting to CMDCollectMoney"); switch (updateTeam) { case Teams.ROBBERS: robberMoneyCount.money -= IncrementValue / 2; Debug.Log($"Decreased Robbers Money {robberMoneyCount.money}"); MoneyDisplay.Instance().UpdateCopsView(robberMoneyCount.money); break; case Teams.COPS: copsMoneyCount.money -= IncrementValue / 2; Debug.Log($"Decreased Cops Money {copsMoneyCount.money}"); MoneyDisplay.Instance().UpdateRobbersView(copsMoneyCount.money); break; } }