Ejemplo n.º 1
0
    private void Start()
    {
        //Night UI
        this.ObserveEveryValueChanged(x => x.nightSession.GetActualDifficulty())
        .Subscribe(x =>
        {
            difficulty.text = nightSession.GetActualDifficulty().ToString();
        });

        this.ObserveEveryValueChanged(x => x.nightSession.GetEnemiesAlive())
        .Subscribe(x =>
        {
            enemiesAlive.text = "Enemies Alive: " + nightSession.GetEnemiesAlive().ToString();
        });

        //Player UI
        AmmoCD.maxValue = playerSession.GetTimeToReload();

        this.ObserveEveryValueChanged(x => x.playerSession.GetAmmo())
        .Subscribe(x =>
        {
            ammo.text = playerSession.GetAmmo().ToString();
        });

        this.ObserveEveryValueChanged(x => x.playerSession.GetActualTimeToReload())
        .Subscribe(x =>
        {
            AmmoCD.value = playerSession.GetActualTimeToReload();
        });
    }
Ejemplo n.º 2
0
    List <Wave> FilterWaves()
    {
        List <Wave> tmp = new List <Wave>();

        for (int i = 0; i < Waves.Count; i++)
        {
            if (Waves[i].getDifficulty() < actualSession.GetActualDifficulty())
            {
                tmp.Add(Waves[i]);
            }
        }

        if (tmp.Count == 0)
        {
            actualSession.AddActualDifficulty(actualSession.GetActualDifficulty() * -1);
        }

        return(tmp);
    }