void getInitialSetupFromDM()
    {
        dataManager.NF_generateQuestion();
        availableShapes     = dataManager.getAvailableShapes();
        answersListCount    = dataManager.getAnswersListCount();
        questionTitle       = dataManager.getCorrectQuestionTitle();
        showReferent        = dataManager.getShowReferent();
        questionTitleToShow = dataManager.getQuestionTitle();
        gameModeDM          = dataManager.gameModeSwitching();
        questionIndexDM     = dataManager.getIndexOfCurrentPlayingQuestion();
        totalQuestionsDM    = dataManager.numberOfQuestionPresented();
        hardModeTime        = dataManager.getHardModeTime();

        if (changeBackground == true)
        {
            int backgroundIndex = Random.Range(0, backgroundsCount);
            backgroundImage = backgroundArray[backgroundIndex];
            foregroundImage = foregroundArray[backgroundIndex];
            frontLayerImage = frontLayerArray[backgroundIndex];

            // set background at random whenever new level is loaded
            background.renderer.material.mainTexture = Resources.Load(NF_Constants._backgroundsPath + backgroundImage) as Texture;
            foreground.renderer.material.mainTexture = Resources.Load(NF_Constants._backgroundsPath + foregroundImage) as Texture;
            frontLayer.renderer.material.mainTexture = Resources.Load(NF_Constants._backgroundsPath + frontLayerImage) as Texture;
        }
        Debug.Log("GC_QuestionLoaded:  " + questionTitle);
        questionLoader.questionInitializer(questionIndexDM, questionTitleToShow, currentCategoryID, gameModeDM, answersListCount, showReferent, questionTitle); // setup question elements
        ropesGenerator.generateRopeForQuestion(totalQuestionsDM, questionTitle, availableShapes, currentCategoryID, gameModeDM, questionTitleToShow);           // generate Ropes
        GameObject correctRope = ropesGenerator.getCorrectRope();

        inputController.inputControllerInitializer(questionTitleToShow, questionTitle, correctRope, answersListCount, currentCategoryID);

        // check hardMode here
//	if(hardModeTime>0){
//		Invoke("createMonkeys",hardModeTime);
//		}

        // call olly creation
        Invoke("createOllyModel", ollyCreationTime);
    }
示例#2
0
    //------------------------------------------------
    private void setDataUsingScriptRefrences()
    {
        //Debug.Log("in setDataUsingScriptRefrences");

        _background = Random.Range(1, 3);        // pick randomly background
        //-------- Place Available Shapes
        shapesControllerSR.placeAvailableShapes(pgDataManager.getAvailableShapes(), pgDataManager.getQuestionTitle());

        //-------- Place Available Landmasses
        islandControllerSR.placeIslandsAndLandmasses(shapesControllerSR.getAnswerSpriteIndex(), pgDataManager.getAnswersListCount(), _background);

        // -------------- Show/Hide Land
        if (_background == 1)
        {
            if (landControllerSR != null)
            {
                landControllerSR.showLand();
            }
            else
            {
                Debug.Log("land is null");
            }
        }
        else if (landControllerSR != null)
        {
            landControllerSR.hideLand();
        }
        else
        {
            Debug.Log("land is null");
        }

        // ------ Change background
        backgroundControllerSR.setBackground(_background);

        if (pgDataManager.getShowReferent())
        {
            referentShapeControllerSR.setReferentSprite(shapesControllerSR.getAnswerSpriteIndex());      // Setting Referent Sprite
        }
        else
        {
            referentShapeControllerSR.setReferentSprite(500);           // Setting
        }
        referentHintControllerSR.setShapeName(shapesControllerSR.getAnswerSpriteIndex());

        // ------- Play VO w.r.t game mode
        if ((int)pgDataManager.gameModeSwitching() == (int)GameModes.mode_different)
        {
            currentMode = GameModes.mode_different;
            int _different = Random.Range(1, 3);
            questionInstructionVO = (new string[] { PG_Constants._soundclipPath + PG_Constants._differentMode + string.Format("all_diff_todo_{0}", _different) });
        }
        else if ((int)pgDataManager.gameModeSwitching() == (int)GameModes.mode_same || (int)pgDataManager.gameModeSwitching() == (int)GameModes.mode_similiar)
        {
            currentMode = GameModes.mode_same;
            int    shapesCount   = pgDataManager.getAnswersListCount();
            string shapeName     = pgDataManager.getQuestionTitle();
            string shapeClipName = null;
            if (shapesCount == 1)
            {
                shapeClipName = "word_" + shapeName.ToLower();
            }
            else
            {
                shapeClipName = "word_" + shapeName.ToLower() + "s";
            }

            questionInstructionVO = (new string[] { PG_Constants._soundclipPath + PG_Constants._find + "all_same_todo_one_2", PG_Constants._soundclipPath + PG_Constants._basicShapes + shapeClipName });
        }
        else if ((int)pgDataManager.gameModeSwitching() == (int)GameModes.mode_counting)
        {
            currentMode = GameModes.mode_counting;
            int    shapesCount   = pgDataManager.getAnswersListCount();
            string shapeName     = pgDataManager.getQuestionTitle();
            string shapeClipName = null;
            if (shapesCount == 1)
            {
                shapeClipName = "word_" + shapeName.ToLower();
            }
            else
            {
                shapeClipName = "word_" + shapeName.ToLower() + "s";
            }

            questionInstructionVO = (new string[] { PG_Constants._soundclipPath + PG_Constants._find + "pond_count_todo_1a", PG_Constants._soundclipPath + PG_Constants._counting + string.Format("number_{0}", shapesCount),
                                                    PG_Constants._soundclipPath + PG_Constants._basicShapes + shapeClipName });
        }

        isUserPlayedTheQuestion          = false;
        loadingQuestionOrLevelInProgress = false;
        shapeContainerStatControllerSR.playAnimation();

        // ------- Hard mode Implementation
        if (hardModeTime > 0)
        {
            hardModeTime  += 4;
            _hardModeCount = 0;
        }
    }