コード例 #1
0
ファイル: FallMain.cs プロジェクト: TheSleepingGamer/NerdFall
    private void SpawnNewQuestion(QuestionData qData)
    {
        GameObject newObject = (GameObject)Instantiate(this.questionObjectPrefab, this.spawnPosition.transform.position, this.spawnPosition.transform.rotation);

        newObject.SetActive(true);
        QuestionComponent qComponent = newObject.GetComponent <QuestionComponent>();

        qComponent.BindQuestionData(qData);
        qComponent.AddListenerToCorrectHit(this.OnCorrectNumberHit);
        qComponent.AddListenerToIncorrectHit(this.OnIncorrectNumberHit);

        this.currentlyActiveQuestObject = qComponent;
    }