Esempio n. 1
0
    private void Correct()
    {
        if (progress == 24)
        {
            print("victory");
            progress = 10;
            GameObject victory = Instantiate(victoryObj, new Vector3(0, 0, 0), Quaternion.identity);
            for (int i = 0; i < canvas.transform.GetChildCount(); i++)
            {
                canvas.gameObject.transform.GetChild(i).gameObject.SetActive(false);
            }
            victory.transform.parent = canvas.transform;
            victory.GetComponent <RectTransform> ().localPosition = new Vector3(0, 0, 0);
            // Load something
        }
        progress++;
        GameObject viking = instrumentList.GetCurrentViking();

        viking.transform.parent        = player.transform;
        viking.transform.localPosition = new Vector3(Random.Range(-3f, -7f), Random.Range(-4f, 0f), 0);
        viking.transform.rotation      = new Quaternion(0, 180, 0, 0);
        viking.GetComponent <SpriteRenderer>().sortingOrder = -(int)(viking.transform.localPosition.y * 10);
        viking.SendMessage("StartWalking");
        player.SendMessage("LoudnessUp");         // Tie this to progressmeter instead
        PlayInstrument();
    }