Ejemplo n.º 1
0
    public void AddHealed()
    {
        PatientsHealed++;

        UIManager.UpdateUI(PatientsHealed);

        //if (PatientsHealed == LevelConfig.PatientsToHeal)
        //{
        //    //win level
        //}
    }
Ejemplo n.º 2
0
    private void GivePointsToPlayer(float pPointsToGive)
    {
        if (pPointsToGive < 0)
        {
            LevelManager?.AddDeath();
        }
        else if (pPointsToGive > 0)
        {
            LevelManager?.AddHealed();
        }

        LevelManager?.AddPoints((int)pPointsToGive);
        AilmentUI.CreateScorePopUpText((int)pPointsToGive);
        StartCoroutine(PointsUIManager.UpdateUI((int)pPointsToGive));
    }
Ejemplo n.º 3
0
    private void Start()
    {
        Time.timeScale = 1;
        UICanvas       = GameObject.FindGameObjectWithTag("MainCanvas").GetComponent <Canvas>();
        var timerUI = Instantiate(ClockUIPrefab, UICanvas.transform);

        timerUI.GetComponent <TimerUIManager>().Initialize(this, LevelConfig.LevelTimeSecs);
        var goalUI = Instantiate(GoalUIPrefab, UICanvas.transform);

        UIManager = goalUI.GetComponent <PointsUIManager>();
        UIManager.Initialize();
        UIManager.UpdateUI(PatientsHealed);
        StartTime = LevelConfig.LevelTimeSecs;
        Timer     = StartTime;
        var sun = Instantiate(SunPrefab);

        DayNightCycle = sun.GetComponent <Animator>();
        var multiplier = 1 / (StartTime / 60);

        DayNightCycle.SetFloat("SpeedMultiplier", multiplier);
    }