private GameInfo gameInfo; // actual words

	// Use this for initialization
	void Start () {
        gameData = GameObject.Find("GameData").GetComponent<GameDataScript>();
        gameInfo = GameObject.Find("GameInfo").GetComponent<GameInfo>();
        recallResults = GameObject.Find("RecallResults").GetComponent<RecallResults>();

        displayResults();
    }
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
     else
     {
         Destroy(this.gameObject);
         return;
     }
 }
Exemple #3
0
    void Start()
    {
#if UNITY_ANDROID
        Opie.instance().head().set_eye_type(EyeType.NEUTRAL, Opie.Head.instant_action());
        Opie.instance().head().set_linked_pose_and_eye_position(0.5f, 0.5f, Opie.Head.transition_action());
#endif

        //Find all the necessary the Game Objects
        gameData      = GameObject.Find("GameData").GetComponent <GameDataScript>();
        gameInfo      = GameObject.Find("GameInfo").GetComponent <GameInfo>();
        recallResults = GameObject.Find("RecallResults").GetComponent <RecallResults>();
        recallResults.Reset();

        originalCard = GameObject.Find("Memory Card").GetComponent <MemoryCardRecall>();
        //originalStar = GameObject.Find("Star").GetComponent<Star>();

        rps        = GameObject.Find("RecallPlaySound").GetComponent <RecallPlaySound>();
        quitButton = GameObject.Find("QuitButton").GetComponent <Button>();

        //Retrieve ordering of the images, all the resources should have already been loaded
        ordering = gameData.Ordering;

        images     = gameInfo.Images;
        sounds     = gameInfo.Sounds;
        words      = gameInfo.Words;
        no_of_card = gameData.N_rows * gameData.N_cols / 2;

        //Shuffle the order of the cards to be Question
        questions = Enumerable.Range(0, no_of_card).ToArray();

        Shuffle(questions);

        answers = new int[no_of_card];
        for (int i = 0; i < no_of_card; i++)
        {
            answers[i] = ordering[questions[i]];
        }

        CardsSetup();

        DeactivateAllCards();
        //Present the first word (sound + transcription)
        NextQuestion();
    }