Exemple #1
0
    void jobReceived(int position)
    {
        wallet.AddMoney(payments[position]);
        //Debug.Log(wallet.money + " dollars");

        items.RemoveAt(position);
        activeItems.RemoveAt(activeItemRemoveIndex);
        payments.RemoveAt(position);
        deliveryTime.RemoveAt(position);
        currentTimes.RemoveAt(position);
        startTimes.RemoveAt(position);
        locations.RemoveAt(activeItemRemoveIndex);

        AdjustIndexes(activeItemRemoveIndex);
        generateJobImage.RemoveJobDisplay(activeItemRemoveIndex);

        itemreceived = 100;
        if (!backpackReceived)
        {
            player.PickupPutdown();
            Destroy(itemInQuestion.transform.parent.gameObject);
        }
        else
        {
            backpackReceived = false;
        }


        //Destroy(clones[position].transform.parent);
        //clones.RemoveAt(position);
    }
Exemple #2
0
        private void OnEnemyDied(EnemyDeathState enemyDeathState)
        {
            enemyDeathState.OnDied -= OnEnemyDied;
            _playerWallet.AddMoney(_waves[_currentWaveNumber].EnemyStaticData.Reward);
            _diedEnemyCount++;

            if (_diedEnemyCount == _spawnedEnemyCount && !NextWaveExist())
            {
                AllEnemyDied?.Invoke();
            }
        }