Exemplo n.º 1
0
        private void CalculateIdleIncomeAndShowNotification()
        {
            UIManager.CloseNotifIfOpen();
            var idleManager = new IdleManager(this, WaveManager);
            int killedMinionCount;
            int passedWaveCount;
            var currencyGainedWhileIdle = idleManager.CalculateIdleIncome(out killedMinionCount, out passedWaveCount);

            Data.IncreaseCurrency(currencyGainedWhileIdle);
            //Debug.Log("currency gained while idle: " + currencyGainedWhileIdle);
            if (currencyGainedWhileIdle != 0)
            {
                if (killedMinionCount == 0)
                {
                    UIManager.CreateNotificications("Welcome back!",
                                                    "Your mages earned " + currencyGainedWhileIdle +
                                                    " gold while you were gone.");
                }
                else
                {
                    UIManager.CreateNotificications("Welcome back!",
                                                    "Your mages killed " + killedMinionCount + " attackers and earned " + currencyGainedWhileIdle +
                                                    " gold while you were gone.");
                }
            }
        }