Exemplo n.º 1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.GetComponent <CharacterBehaviour>() == null)
        {
            other.gameObject.SetActive(false);
            GameEnums.LevelName levelName     = other.transform.parent.GetComponent <PatientOnHospitalBehaviour>().LevelName;
            LevelProgress       levelProgress = SaveManager.GetLevelProgress(levelName);
            if (levelProgress != null)
            {
                levelProgress.patientLeftBed = true;
                SaveManager.SaveProgressFile();
            }
            else
            {
                Debug.LogError("no save file");
            }
        }

        // finish game
        if (SaveManager.GetLevelProgress(GameEnums.LevelName.Dog) != null && SaveManager.GetLevelProgress(GameEnums.LevelName.Dog).patientLeftBed)
        {
            if (SaveManager.GetLevelProgress(GameEnums.LevelName.Robot) != null && SaveManager.GetLevelProgress(GameEnums.LevelName.Robot).patientLeftBed)
            {
                if (SaveManager.GetLevelProgress(GameEnums.LevelName.Night) != null && SaveManager.GetLevelProgress(GameEnums.LevelName.Night).patientLeftBed)
                {
                    OpenVictoryCanvas();
                }
            }
        }
    }
Exemplo n.º 2
0
 public LevelProgress(GameEnums.LevelName name)
 {
     levelName       = name;
     levelConcluded  = false;
     patientLeftBed  = false;
     attemptedToTalk = false;
 }
Exemplo n.º 3
0
    public static LevelProgress GetLevelProgress(GameEnums.LevelName levelName)
    {
        if (currentProgress == null)
        {
            Debug.Log("Progress file not initialized. Cannot add level progress.");
            return(null);
        }

        for (int i = 0; i < currentProgress.levels.Count; i++)
        {
            if (currentProgress.levels[i].levelName == levelName)
            {
                return(currentProgress.levels[i]);
            }
        }

        LevelProgress lp = new LevelProgress(levelName);

        currentProgress.levels.Add(lp);
        return(lp);
    }