예제 #1
0
    void Start()
    {
        qHandler = GameObject.FindGameObjectWithTag("GameController").GetComponent<QuestionnaireHandler>();

        if (!qHandler.QuestionnaireEnabled) {
            DoneTesting = true;
            CurrentScenario = ScenarioState.WITH_TAIS;
        }
        else {
            if (CurrentScenario == ScenarioState.NONE) {
                CurrentScenario = Random.Range(0, 2) == 0 ? ScenarioState.WITH_TAIS : ScenarioState.WITHOUT_TAIS;
            }
        }
    }
예제 #2
0
    void Start()
    {
        enemies = new List<Entity>();
        players = new List<PlayerController>();

        PlayerController player = (Instantiate(Resources.Load("Player/PlayerObject")) as GameObject).GetComponent<PlayerController>();
        GameObject[] points = GameObject.FindGameObjectsWithTag("Waypoint");
        foreach (GameObject point in points) {
            if (point.transform.name.Contains("End")) {
                Vector3 targetPos = point.transform.position;
                targetPos.y += StartYPosition;
                player.transform.position = targetPos;
                break;
            }
        }
        players.Add(player);

        miniMapCam = GameObject.FindGameObjectWithTag("MiniMapCam");

        audioSources = new Dictionary<string, AudioSource>();

        addAudioSource("Background", BackgroundMusic);
        addAudioSource("Build", BuildMusic, 0.5f, true);
        addAudioSource("Combat", CombatMusic, 0.1f, true);

        qHandler = this.GetComponent<QuestionnaireHandler>();
        if (qHandler == null) {
            qHandler = this.GetComponentInChildren<QuestionnaireHandler>();
        }

        if (!qHandler.QuestionnaireEnabled) {
            CurrentGameState = GameState.MENU;
        }

        scenarioHandler = GameObject.FindGameObjectWithTag("ScenarioHandler").GetComponent<ScenarioHandler>();

        menuController = this.GetComponent<MenuController>();
        if (menuController == null) {
            menuController = this.GetComponentInChildren<MenuController>();
        }
    }