Exemplo n.º 1
0
        /// <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}");
            Teams 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;
            }
        }
Exemplo n.º 2
0
 public void Awake()
 {
     if (_instance != null && _instance != this)
     {
         //*Debug.Log($"Destroying instance");
         Destroy(this.gameObject);
     }
     else
     {
         //*Debug.Log($"Setting instance");
         _instance = this;
     }
 }
Exemplo n.º 3
0
        /// <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}");
            Teams 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;
            }
        }