Exemplo n.º 1
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;
        }
    }