Exemplo n.º 1
0
    public static void Victory()
    {
        //Gather all coins left
        GameObject[] coins;
        coins = GameObject.FindGameObjectsWithTag("Coin");
        foreach (GameObject coin in coins)
        {
            coin.GetComponent <Coin> ().FastGather();
        }
        //FIXME add small delay for balance accounting, playing coin gather sfx, anything else.
        //fill it with fireworks, for example.

        //Output balance
        Debug.Log("Victory. Balance: " + FinanceManager.GetBalance());
        instance.StopAllCoroutines();
        instance.currentPhase = WaveManagerPhase.StopGame;
        if (instance.gameEndedEvent != null)
        {
            instance.gameEndedEvent.Invoke();
        }
    }