Exemplo n.º 1
0
        private void createEasyRandomPatient()
        {
            var     rand    = (int)(Random.Range(0, 4));
            Patient patient = null;

            switch (rand)
            {
            case 0:
                patient = (Instantiate(StevePatientTutorialBloodPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                break;

            case 1:
                patient = (Instantiate(StevePatientTutorialCrazyPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                break;

            case 2:
                patient = (Instantiate(AdamTutorialPatientCrazyPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                break;

            case 3:
                patient = (Instantiate(AdamTutorialPatientBloodPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                break;
            }
            if (patient != null && gameManager != null)
            {
                patient.gameManager = gameManager;

                //Add Patient to patient list
                GameManager.AddPatient(patient);
            }
        }
Exemplo n.º 2
0
        private void createRandomPatient()
        {
            var     rand    = (int)(Random.Range(0, 10));
            Patient patient = null;

            switch (rand)
            {
            case 0:
                patient = (Instantiate(StevePatientCrazyPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                break;

            case 1:
                patient = (Instantiate(StevePatientKnifePrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                break;

            case 2:
                patient = (Instantiate(StevePatientBloodPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                break;

            case 3:
                patient = (Instantiate(StevePatientVomitPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                break;

            case 4:
                patient = (Instantiate(StevePatientPossessedPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                break;

            case 5:
                patient = (Instantiate(AdamPatientKnifePrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                break;

            case 6:
                patient = (Instantiate(AdamPatientCrazyPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                break;

            case 7:
                patient = (Instantiate(AdamPatientBloodPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                break;

            case 8:
                patient = (Instantiate(AdamPatientVomitPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                break;

            case 9:
                patient = (Instantiate(AdamPatientPossessedPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                break;
            }
            if (patient != null && gameManager != null)
            {
                patient.gameManager = gameManager;
                //Add Patient to patient list
                GameManager.AddPatient(patient);
            }
        }
        // Update is called once per frame
        void Update()
        {
            if (canSpawnPatient())
            {
                Patient patient = null;
                switch (GameFlowManager.GamePhase)
                {
                case GameFlowState.PhaseTutorial:

                case GameFlowState.PhaseEasy:
                    var randEasy = (int)(Random.Range(0, 4));
                    switch (randEasy)
                    {
                    case 0:
                        patient = (Instantiate(StevePatientCrazyPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 1:
                        patient = (Instantiate(StevePatientBloodPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 2:
                        patient = (Instantiate(AdamPatientCrazyPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 3:
                        patient = (Instantiate(AdamPatientBloodPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;
                    }
                    break;

                case GameFlowState.PhaseMedium:
                    var randMedium = (int)(Random.Range(0, 8));
                    switch (randMedium)
                    {
                    case 0:
                        patient = (Instantiate(StevePatientKnifePrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 1:
                        patient = (Instantiate(StevePatientCrazyPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 2:
                        patient = (Instantiate(StevePatientBloodPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 3:
                        patient = (Instantiate(StevePatientVomitPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 4:
                        patient = (Instantiate(AdamPatientKnifePrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 5:
                        patient = (Instantiate(AdamPatientCrazyPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 6:
                        patient = (Instantiate(AdamPatientBloodPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 7:
                        patient = (Instantiate(AdamPatientVomitPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;
                    }
                    break;

                case GameFlowState.PhaseHard:
                    var randHard = (int)(Random.Range(0, 10));
                    switch (randHard)
                    {
                    case 0:
                        patient = (Instantiate(StevePatientCrazyPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 1:
                        patient = (Instantiate(StevePatientKnifePrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 2:
                        patient = (Instantiate(StevePatientBloodPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 3:
                        patient = (Instantiate(StevePatientVomitPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 4:
                        patient = (Instantiate(StevePatientPossessedPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 5:
                        patient = (Instantiate(AdamPatientKnifePrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 6:
                        patient = (Instantiate(AdamPatientCrazyPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 7:
                        patient = (Instantiate(AdamPatientBloodPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 8:
                        patient = (Instantiate(AdamPatientVomitPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 9:
                        patient = (Instantiate(AdamPatientPossessedPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;
                    }
                    break;

                case GameFlowState.LastPhase:
                    var randLast = (int)(Random.Range(0, 10));
                    switch (randLast)
                    {
                    case 0:
                        patient = (Instantiate(StevePatientCrazyPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 1:
                        patient = (Instantiate(StevePatientKnifePrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 2:
                        patient = (Instantiate(StevePatientBloodPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 3:
                        patient = (Instantiate(StevePatientVomitPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 4:
                        patient = (Instantiate(StevePatientPossessedPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 5:
                        patient = (Instantiate(AdamPatientKnifePrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 6:
                        patient = (Instantiate(AdamPatientCrazyPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 7:
                        patient = (Instantiate(AdamPatientBloodPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 8:
                        patient = (Instantiate(AdamPatientVomitPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;

                    case 9:
                        patient = (Instantiate(AdamPatientPossessedPrefab, transform.position, Quaternion.identity) as GameObject).transform.GetChild(0).gameObject.GetComponent <Patient>();
                        break;
                    }
                    break;

                case GameFlowState.End:
                    break;
                }
                if (patient != null && gameManager != null)
                {
                    patient.gameManager = gameManager;

                    //Add Patient to patient list
                    GameManager.AddPatient(patient);
                }
            }
        }