Ejemplo n.º 1
0
    new void Start()
    {
        rosetta = GameObject.Find("Rosetta").GetComponent <Rosetta> ();
        mcRef   = GameObject.Find("MasterController").GetComponent <MasterControllerScript> ();
        ds      = mcRef.getStorage();

        mcRef.playMusic("QAMusic");

        /* retrieve status from MasterController general storage */

        /*enabled = new bool[qa.Length];
         * for (int i = 0; i < qa.Length; ++i) {
         *
         *      enabled [i] = mcRef.getStorage ().retrieveBoolValue ("QuestionSetIsEnabled" + i);
         *
         * }
         *
         * header = new int[qa.Length];
         * for (int i = 0; i < qa.Length; ++i) {
         *
         *      header [i] = mcRef.getStorage ().retrieveIntValue ("QuestionSetHeader" + i);
         *
         * }*/
        keyChannel = ds.retrieveIntValue("CurrentFlameIndex");
        nLevel     = ds.retrieveIntValue("Level");
        if (nLevel == 0)
        {
            nLevel = 1;
        }
        imageSwitch.setChannel(keyChannel);
        keyImage.GetComponent <Image> ().sprite = imageSwitch.getSprite();

        string sss = obtainTexts.getStringId(keyChannel);

        youGotAKeyText.GetComponent <Text> ().text = rosetta.retrieveString(sss);

        state = QAControllerState.idle;
        questionLetterOutput = 0.0f;
        elapsedTime          = 0.0f;
        answerGO             = new GameObject[maxAnswers];
        currentQuestion      = 0;

        //string curLev = ds.retrieveStringValue ("CurrentLevel");
        //int n = ds.retrieveIntValue (curLev + "NumberOfKeys");
//		int n = ds.retrieveIntValue ("GlobalQACounter");
//		ds.storeIntValue ("GlobalQACounter", n + 1);
//
//		n = FirstSetIndex + (n % (LastSetIndex-FirstSetIndex+1)) - 1;
//
//		bankIndex = n;

        qa = QAHelper.getNextBank();

        qa.reset();
        qb = qa.getNextBank();
        qb.reset();

        nMisses = 0;

        flowerAnim = flower.GetComponent <Animator> ();
        spark1Anim = spark1.GetComponent <Animator> ();
        spark2Anim = spark2.GetComponent <Animator> ();
        spark3Anim = spark3.GetComponent <Animator> ();

        keyImageFader       = keyImage.GetComponent <UIImageFader> ();
        youGotAKeyTextFader = youGotAKeyText.GetComponent <UITextFader> ();

        particles.Stop();
        spark1.transform.localScale = Vector3.zero;
        spark2.transform.localScale = Vector3.zero;
        spark3.transform.localScale = Vector3.zero;
    }