コード例 #1
0
    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();
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        //Disable the "go" button while the animation is playing
        goButton = GameObject.Find("GoButton").GetComponent <Button>();
        goButton.interactable = false;
        goButton.gameObject.SetActive(false);

        gameData = GameObject.Find("GameData").GetComponent <GameDataScript>();

        int    originnum       = Math.Max(gameData.Iteration - 1, 0);
        int    destinationnum  = Math.Max(gameData.Iteration, 1);
        string originname      = "level" + originnum.ToString();
        string destinationname = "level" + destinationnum.ToString();

        //Defining the origin and destination of the avatar
        origin             = GameObject.Find(originname);
        destination        = GameObject.Find(destinationname);
        transform.position = origin.transform.position + new Vector3(0, 0, -1);
#if UNITY_ANDROID && !UNITY_EDITOR
        //Get Opie to look at the animation (by looking at its tummy)
        Opie.instance().head().set_linked_pose_and_eye_position(0.5f, 0f, Opie.Head.transition_action());
#endif
        //Using iTween script functions to move the object from origin to destination (the last argument calls
        //the function activateGoButton() upon completion of the animation)
        iTween.MoveTo(transform.gameObject, iTween.Hash("position", destination.transform.position + new Vector3(0, 0, -1),
                                                        "speed", 1, "delay", 2, "easetype", iTween.EaseType.linear, "oncomplete", "ActivateGoButton"));
    }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     GameData = GameObject.FindGameObjectWithTag("GameData").GetComponent <GameDataScript>();
     if (GameData.uniHealth <= 0)
     {
         grade.GetComponent <Text>().text        = "F";
         teachersNote.GetComponent <Text>().text = "See me after class";
     }
     else if (GameData.uniHealth <= 5)
     {
         grade.GetComponent <Text>().text        = "D";
         teachersNote.GetComponent <Text>().text = "You should put some more work in.";
     }
     else if (GameData.uniHealth <= 10)
     {
         grade.GetComponent <Text>().text        = "C";
         teachersNote.GetComponent <Text>().text = "Satisfactory.";
     }
     else if (GameData.uniHealth <= 15)
     {
         grade.GetComponent <Text>().text        = "B";
         teachersNote.GetComponent <Text>().text = "Not bad!";
     }
     else if (GameData.uniHealth <= 19)
     {
         grade.GetComponent <Text>().text        = "A";
         teachersNote.GetComponent <Text>().text = "Good Job!";
     }
     else if (GameData.uniHealth == 20)
     {
         grade.GetComponent <Text>().text        = "A+";
         teachersNote.GetComponent <Text>().text = "Excellent!";
     }
 }
コード例 #4
0
 // Use this for initialization
 void Start()
 {
     gameData = GameObject.FindWithTag("GameData").GetComponent <GameDataScript>();
     //we get the gamedata script for later reference
     levelUpRadialMenu   = GameObject.FindGameObjectWithTag("LevelUpRadialMenu").GetComponent <TowerRadialMenuScript>();
     targetingRadialMenu = GameObject.FindGameObjectWithTag("TargetingRadialMenu").GetComponent <TowerRadialMenuScript>();
 }
コード例 #5
0
 // Use this for initialization
 void Start()
 {
     gDS = GameObject.FindGameObjectWithTag("GameData").GetComponent <GameDataScript>();
     LeapGame.SetActive(gDS.LeapGame);
     SnipeGame.SetActive(gDS.SniperGame);
     ChargeGame.SetActive(gDS.ChargeGame);
 }
コード例 #6
0
    //This function ensures that the object is not destructed in between scenes
    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
            DontDestroyOnLoad(this.gameObject);
        }
        else
        {
            Destroy(this.gameObject);
            return;
        }


        //When creating the game data, set the iteration to one (one card)
        // initialise this here is to make sure this get set
        // before it is being used in the start of moveAvatar.cs
        mainLog   = GameObject.Find("MainLogging").GetComponent <MainLogging>();
        Iteration = mainLog.GetLastSavedLevel() + 1;

        extRes = GameObject.Find("LoadExternalResources").GetComponent <LoadExternalResources>();

        // loading the question randomly
        //Ordering = Enumerable.Range(0, extRes.MemoryImages.Length).ToArray();
        //Shuffle(Ordering); //Shuffle the cards

        ArrangeGrid(Iteration);
        // load the question based on the stats
        //Ordering = GetNewOrdering();
    }
コード例 #7
0
    IEnumerator Start()
    {
        splashImage.canvasRenderer.SetAlpha(0.0F);

        FadeIn();
        yield return(new WaitForSeconds(2.5f));

        FadeOut();
        yield return(new WaitForSeconds(2.5f));

        GameDataScript gameDataScript = GameObject.Find("GameData").GetComponent <GameDataScript>();

        gameDataScript.inLevel = true;
        if (gameDataScript.roundNum == 2)
        {
            Application.LoadLevel("Level2");
        }
        if (gameDataScript.roundNum == 3)
        {
            Application.LoadLevel("Level3");
        }
        if (gameDataScript.roundNum == 4)
        {
            Application.LoadLevel("Level4");
        }
    }
コード例 #8
0
    void Start()
    {
        //Find all the necessary the Game Objects
        gameData   = GameObject.Find("GameData").GetComponent <GameDataScript>();
        logInfo    = GameObject.Find("ProfileInfo").GetComponent <LogInfo>();
        extRes     = GameObject.Find("LoadExternalResources").GetComponent <LoadExternalResources>();
        mrps       = GameObject.Find("MemRepeatPlaySound").GetComponent <MemRepeatPlaySound>();
        quitButton = GameObject.Find("QuitButton").GetComponent <Button>();

        //Retrieve ordering of the images, all the resources should have already been loaded
        //ordering = gameData.Ordering;
        // the iteration has increased at the end of the recalled scene, so -1 to bring it back to the actual level
        //questionNo = gameData.Iteration - 1;

        // an ID randomly chosen from the last seen set of questions
        int chosen = gameData.MemRepeatID; // start counting from 0

        MemoryCard.sprite = extRes.MemoryImages[chosen];
        targetSound       = extRes.MemorySounds[chosen];
        targetText        = extRes.MemoryWords[chosen];

        TranscriptionText.text = targetText;
        RecordingText.text     = "";

        StartCoroutine(PlayTargetSound());
#if UNITY_ANDROID && !UNITY_EDITOR
        // Opie looks down at the belly
        Opie.instance().head().set_linked_pose_and_eye_position(0.5f, 0.0f, Opie.Head.transition_action());
#endif
    }
コード例 #9
0
    // At the start of the game..
    void Start()
    {
        // Assign the Rigidbody component to our private rb variable
        rb = GetComponent <Rigidbody>();

        // Set count
        count = 0;

        // Set health
        health = maxHealth;

        GameObject data = GameObject.Find("GameData");

        if (data != null)
        {
            GameDataScript scr = (GameDataScript)data.GetComponent("GameDataScript");
            health    = scr.hoverboardhealth;
            maxHealth = scr.hoverboardhealth;
            speed     = scr.hoverboardacc;
            baseSpeed = scr.hoverboardspeed;
        }
        // Run the SetCountText function to update the UI (see below)
        SetCountText();
        // Set the text property of our Win Text UI to an empty string, making the 'You Win' (game over message) blank
    }
コード例 #10
0
    private void updateGameplayHUDAndScoreCard()
    {
        GameDataScript player1 = GameObject.Find("GameData").GetComponent <GameDataScript> ();

        if (player1.currentMode == 0 || player1.currentMode == 1)
        {
            int holeStrokesp1 = GameObject.Find("Ball").GetComponent <BallRigidBody> ().strokeCount;

            //Actually update GameData and Scorecard text
            UpdateHoleScore(player1, player1.currentHole, holeStrokesp1);

            //Advance to next hole
            player1.currentHole++;
        }
        else if (player1.currentMode == 2 || player1.currentMode == 3)
        {
            GameDataScript player2       = GameObject.Find("GameDatap2").GetComponent <GameDataScript> ();
            int            holeStrokesp1 = GameObject.Find("Ballp1").GetComponent <MultiBallRigidBodyP1> ().strokeCount;
            int            holeStrokesp2 = GameObject.Find("Ballp2").GetComponent <MultiBallRigidBodyP2> ().strokeCount;

            //Actually update GameData and Scorecard text
            UpdateHoleScore(player1, player1.currentHole, holeStrokesp1);
            UpdateHoleScore(player2, player2.currentHole, holeStrokesp2);

            //Advance to next hole
            player1.currentHole++;
            player2.currentHole++;
        }
    }
コード例 #11
0
    // Use this for initialization
    void Start()
    {
        GameObject gameData = GameObject.Find("GameData");

        if (gameData != null)
        {
            GameDataScript gameDataScript = gameData.GetComponent <GameDataScript> ();
            GameObject     player1        = GameObject.Find("Player1");
            if (player1 != null)
            {
                PlayerScript playerScript = player1.GetComponent <PlayerScript> ();
                if (playerScript.p1Throw == true)
                {
                    GetComponent <Rigidbody2D> ().AddForce(new Vector2(gameDataScript.p1riceSpeed, 0.0f));
                    playerScript.p1Throw = false;
                }
            }
            GameObject player2 = GameObject.Find("Player2");
            if (player2 != null)
            {
                Player2Script player2Script = player2.GetComponent <Player2Script> ();
                if (player2Script.p2Throw == true)
                {
                    GetComponent <Rigidbody2D> ().AddForce(new Vector2(gameDataScript.p2riceSpeed, 0.0f));
                    player2Script.p2Throw = false;
                }
            }
        }
        StartCoroutine(BulletDelayedDestroy());
    }
コード例 #12
0
 // Use this for initialization
 void Start()
 {
     towerPrice = tower.GetComponentInChildren <TowerShootsScript>().cost;
     gameData   = GameObject.FindGameObjectWithTag("GameData").GetComponent <GameDataScript>();
     hoverTower = Instantiate(tower);
     hoverTower.SetActive(false);
     hoverTower.GetComponentInChildren <SpriteRenderer>().enabled = true;
     RemoveFunctionFromPrefab();
 }
コード例 #13
0
ファイル: CannonballScript.cs プロジェクト: Clodial/OCDZelda
	// Update is called once per frame
	void Update ()
    {
        gameDataScript = gameData.GetComponent<GameDataScript>();
        if (gameDataScript.changeRoom == 1) DestroyObject(gameObject);

        transform.Translate(Vector3.down * Time.deltaTime);

        if (Time.time - time > 5) DestroyObject(gameObject);
	}
コード例 #14
0
 void Start()
 {
     sceneToLoad           = "";
     mapSelectionText.text = "";
     gameData = GameObject.Find("GameData");
     if (gameData != null)
     {
         gameDataScript = gameData.GetComponent <GameDataScript>();
     }
 }
コード例 #15
0
    //reset player score fields on score card
    public void clearScoreCard()
    {
        GameDataScript player1 = GameObject.Find("GameData").GetComponent <GameDataScript> ();

        player1.overallScore = 0;
        player1.overPar      = 0;
        GameObject.Find("H1Score").GetComponent <Text> ().text      = "";
        GameObject.Find("H2Score").GetComponent <Text> ().text      = "";
        GameObject.Find("H3Score").GetComponent <Text> ().text      = "";
        GameObject.Find("AllHoleScore").GetComponent <Text> ().text = "";
    }
コード例 #16
0
 void Start()
 {
     if (GameObject.Find("GameData").GetComponent <GameDataScript>() != null)
     {
         gds = GameObject.Find("GameData").GetComponent <GameDataScript>();
     }
     mTrackableBehaviour = GetComponent <TrackableBehaviour>();
     if (mTrackableBehaviour)
     {
         mTrackableBehaviour.RegisterTrackableEventHandler(this);
     }
 }
コード例 #17
0
 // Use this for initialization
 void Start()
 {
     if (instance != null)
     {
         Destroy(this);
     }
     else
     {
         DontDestroyOnLoad(this);
         instance = this;
     }
 }
コード例 #18
0
 void Start()
 {
     timeFromMovement     = 0.0f;
     ballHasCollided      = false;
     samuraiAbilityActive = false;
     lineRenderer         = GetComponent <LineRenderer>();
     rb                 = GetComponent <Rigidbody2D>();
     gameController     = GameObject.Find("GameController");
     TeamSelection      = GameObject.Find("GameData");
     CameraControl      = GameObject.FindGameObjectWithTag("MainCamera");
     CameraContolScript = CameraControl.GetComponent <CameraController>();
     if (gameController != null)
     {
         gameControllerScript = gameController.GetComponent <GameController>();
     }
     if (TeamSelection != null)
     {
         SelectionMangerScript = TeamSelection.GetComponent <GameDataScript>();
     }
     if (CameraControl != null)
     {
         CameraContolScript = CameraControl.GetComponent <CameraController>();
     }
     ballDead             = false;
     isMoving             = false;
     hpAndDamageText.text = "HP: " + hp.ToString() + hpAndDamageText.text + "DMG: " + Attack.ToString();
     if (SelectionMangerScript.SceneLoaded == "LevelGlacier")
     {
         rb.drag = 0.75f;
         GameText.GetComponent <Text>().color = Color.black;
     }
     else if (SelectionMangerScript.SceneLoaded == "LevelBeach")
     {
         rb.drag = 1.0f;
         GameText.GetComponent <Text>().color = Color.black;
     }
     else if (SelectionMangerScript.SceneLoaded == "LevelJapanese")
     {
         GameText.GetComponent <Text>().color = Color.black;
     }
     else if (SelectionMangerScript.SceneLoaded == "LevelJungle")
     {
         GameText.GetComponent <Text>().color = Color.yellow;
     }
     else if (SelectionMangerScript.SceneLoaded == "LevelDungeon")
     {
         GameText.GetComponent <Text>().color = Color.yellow;
     }
     else
     {
         rb.drag = 0.95f;
     }
 }
コード例 #19
0
    // Use this for initialization
    void Start()
    {
        //Find the objects containing the game data and the profile information
        gameData   = GameObject.Find("GameData").GetComponent <GameDataScript>();
        logInfo    = GameObject.Find("ProfileInfo").GetComponent <LogInfo>();
        extRes     = GameObject.Find("LoadExternalResources").GetComponent <LoadExternalResources>();
        quitButton = GameObject.Find("QuitButton").GetComponent <Button>();
        //goButton = GameObject.Find("GoButton").GetComponent<Button>();
        restartBtn = GameObject.Find("RestartButton").GetComponent <Button>();

        // move the loading resources to here to hide loading time
        // only load if not loaded
        if (!extRes.IsLoaded())
        {
            resourcesLoaded = false;
            startTime       = Time.realtimeSinceStartup;
            extRes.LoadMemoryGameResources();
            restartBtn.interactable = false;
            goButton.interactable   = false;
        }
        else
        {
            goButton.interactable   = true;
            restartBtn.interactable = true;
        }



        //Quit the application if the player has reached the last level
        if (gameData.Iteration > gameData.TotalLevel)
        {
            QuitApp();
        }


        if (gameData.Iteration == 1)
        {
            restartBtn.gameObject.SetActive(false);
        }
        else
        {
            restartBtn.gameObject.SetActive(true);
        }

        //Display the name of the user
        TextWritten.text = logInfo.PlayerName;
#if UNITY_ANDROID && !UNITY_EDITOR
        //Get Opie to look down at its tummy to observe progress
        Opie.instance().head().set_eye_type(EyeType.NEUTRAL, Opie.Head.instant_action());
        Opie.instance().head().set_linked_pose_and_eye_position(0.5f, 0.0f, Opie.Head.transition_action());
#endif
    }
コード例 #20
0
    void UpdateHoleScore(GameDataScript player, int holeNum, int holeStrokes)
    {
        Color  scoreColor;
        string p2ifp2;

        if (player.name == "GameData")
        {
            p2ifp2 = "";
        }
        else
        {
            p2ifp2 = "p2";
        }

        int holePar    = player.holePars [holeNum - 1];
        int amtOverPar = holeStrokes - holePar;

        player.overPar += amtOverPar;
        if (amtOverPar > 0)
        {
            scoreColor = Color.blue;
        }
        else if (amtOverPar == 0)
        {
            scoreColor = Color.black;
        }
        else
        {
            scoreColor = Color.red;
        }
        GameObject.Find("H" + holeNum + "Score" + p2ifp2).GetComponent <Text> ().text  = holeStrokes + "";
        GameObject.Find("H" + holeNum + "Score" + p2ifp2).GetComponent <Text> ().color = scoreColor;

        int  overPar = player.overPar;
        Text score   = GameObject.Find("OverallScore").GetComponent <Text>();

        if (overPar == 0)
        {
            score.text = "Even";
        }
        else if (overPar > 0)
        {
            score.text = overPar + " Over";
        }
        else
        {
            score.text = Mathf.Abs(overPar) + " Under";
        }

        player.overallScore += holeStrokes;
        GameObject.Find("AllHoleScore" + p2ifp2).GetComponent <Text> ().text = player.overallScore + "";
    }
コード例 #21
0
    // Update is called once per frame
    void Update()
    {
        GameObject gameData = GameObject.Find("GameData");

        if (gameData != null)
        {
            GameDataScript gameDataScript = gameData.GetComponent <GameDataScript>();
            p1Score.text = gameDataScript.player1Score.ToString();
            p2Score.text = gameDataScript.player2Score.ToString();
            p3Score.text = gameDataScript.player3Score.ToString();
            p4Score.text = gameDataScript.player4Score.ToString();
        }
    }
コード例 #22
0
 //This function ensures that the object is not destructed in between scenes
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
     else
     {
         Destroy(this.gameObject);
         return;
     }
 }
コード例 #23
0
    void Start()
    {
        //Find all the necessary the Game Objects
        gameData     = GameObject.Find("GameData").GetComponent <GameDataScript>();
        logInfo      = GameObject.Find("ProfileInfo").GetComponent <LogInfo>();
        originalCard = GameObject.Find("Memory Card").GetComponent <MemoryCardRecall>();
        originalStar = GameObject.Find("Star").GetComponent <Star>();
        extRes       = GameObject.Find("LoadExternalResources").GetComponent <LoadExternalResources>();
        rps          = GameObject.Find("RecallPlaySound").GetComponent <RecallPlaySound>();
        quitButton   = GameObject.Find("QuitButton").GetComponent <Button>();
        mainLog      = GameObject.Find("MainLogging").GetComponent <MainLogging>();


#if UNITY_ANDROID && !UNITY_EDITOR
        //Opie looks up with NEUTRAL emotion
        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

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

        images   = extRes.MemoryImages;
        sounds   = extRes.MemorySounds;
        words    = extRes.MemoryWords;
        noOfCard = gameData.NRows * gameData.NCols / 2;

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

        Shuffle(questions);

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

        CardsSetup();

        //Initializing the vectors of correct and incorrect answers
        correct        = new List <string>();
        incorrect      = new List <string>();
        oneShotCorrect = new List <string>();
        //mcbn.GetComponent<Button>().interactable = false;

        DeactivateAllCards();
        //Present the first word (sound + transcription)
        NextQuestion();
    }
コード例 #24
0
    private void Awake()
    {
        quitButton = GameObject.Find("QuitButton").GetComponent <Button>();
        gameInfo   = GameObject.Find("GameInfo").GetComponent <GameInfo>();
        gameData   = GameObject.Find("GameData").GetComponent <GameDataScript>();
        mps        = GameObject.Find("MemoryPlaySound").GetComponent <MemoryPlaySound>();
        language   = gameInfo.Language;
        //Retrieve ordering of the images
        ordering = gameData.Ordering;

        images = gameInfo.Images;
        sounds = gameInfo.Sounds;
        words  = gameInfo.Words;
    }
コード例 #25
0
    // Use this for initialization
    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
        //When entering this scene, stop the idle motion so that Opie stops scanning
        //the environment with its eyes
//#if UNITY_ANDROID
//        Opie.instance().behaviours ("idle_motion").stop (Opie.Behaviour.instant_action ());
//#endif
        //Find the object containing profile information
        gameInfo = GameObject.Find("GameInfo").GetComponent <GameInfo>();
        gameData = GameObject.Find("GameData").GetComponent <GameDataScript>();
    }
コード例 #26
0
    // Use this for initialization
    void Start()
    {
        GameObject gameData = GameObject.Find("GameDataObject");

        dbConnectionString = "URI=file:" + Application.dataPath + "/Database.sqlite"; //filepath

        gameDataScript = gameData.GetComponent <GameDataScript>();                    //This is used to transfer the PK between all scenes

        //Set to false whenever main menu reloads
        okButton.SetActive(false);
        startButton.SetActive(true);
        quitButton.SetActive(true);
        loadButton.SetActive(true);
        nameText.enabled     = false;
        playerIdText.enabled = false;
    }
コード例 #27
0
    void Start()
    {
        state = 0;
        score = 0;
        GameDataScript gds = GameObject.Find("GameData").GetComponent <GameDataScript>();

        score = (int)gds.maxHeight;
        label.guiText.text = score + " ケロメートル";
        uss.OnReceive((JSONObject result) => {
            int r = (int)result.GetField("rank").n;
            if (r >= 1)
            {
                rank.text = "" + r + "位";
            }
        });
    }
コード例 #28
0
 void Start()
 {
     //find and get the gamedata instance at runtime
     gameData = GameObject.Find("GameData");
     if (gameData != null)
     {
         gameDataScript = gameData.GetComponent <GameDataScript>();
         gameDataScript.player1selection = 0;
         gameDataScript.player2selection = 0;
     }
     else
     {
         gameData = new GameObject("GameData");
         gameData.AddComponent <GameDataScript>();
     }
     HelpControl();
 }
コード例 #29
0
ファイル: ShopUI.cs プロジェクト: LogicalShark/VR-is-hard
    void Start()
    {
        GameObject data = GameObject.Find("GameData");

        scr = (GameDataScript)data.GetComponent("GameDataScript");
        Button btn = button1.GetComponent <Button>();

        btn.onClick.AddListener(Board1);
        btn = button2.GetComponent <Button>();
        btn.onClick.AddListener(Board2);
        btn = button3.GetComponent <Button>();
        btn.onClick.AddListener(Board3);
        btn = button4.GetComponent <Button>();
        btn.onClick.AddListener(Board4);
        btn = button5.GetComponent <Button>();
        btn.onClick.AddListener(NextLevel);
        scr.level += 1;
    }
コード例 #30
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();
    }
コード例 #31
0
    void Start()
    {
        //Find the objects containing Game Data and Profile Info
        gameData = GameObject.Find("GameData").GetComponent <GameDataScript>();

        //Retrieve ordering of the images
        ordering = gameData.Ordering;
#if UNITY_ANDROID && !UNITY_EDITOR
        //Opie looks up with NEUTRAL emotion
        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
        StateMachineInit();
        CardsSetup();
        mps = GameObject.Find("MemoryPlaySound").GetComponent <MemoryPlaySound>();



        //UnityEngine.SceneManagement.SceneManager.LoadScene("Recall");
    }