Ejemplo n.º 1
0
    public void configureGame(int thisInt)
    {
        assignIndex = thisInt;
        Assignment assignToUse = AppManager.s_instance.currentAssignments[assignIndex];

        matrixOfCSVData = parseContent(AppManager.s_instance.currentAssignments[assignIndex].content);
        useImages       = AppManager.s_instance.currentAssignments[assignIndex].hasImages;
        if (useImages)
        {
            directoryForAssignment = AppManager.s_instance.currentAssignments[assignIndex].imgDir;
        }
        myCanvas           = GameObject.Find("Canvas").GetComponent <Canvas>();
        screenWidth        = myCanvas.GetComponent <RectTransform> ().rect.width;
        submitButton       = GameObject.Find("SubmitButton");    //TODO GET RID OF ALL .FINDS
        scaleFactor        = GameObject.Find("Canvas").GetComponent <Canvas> ().scaleFactor;
        greenCheck         = GameObject.Find("greenCheck").GetComponent <PopUpGraphic> ();
        parentCanvas       = GameObject.FindGameObjectWithTag("shaker");
        draggableGUIHolder = GameObject.Find("DraggableGUIHolder");
        redX = GameObject.Find("redX").GetComponent <PopUpGraphic> ();
        Input.multiTouchEnabled = true;

        //list init
        allTerms = new List <SequenceTerm> ();                //use this to store per sequence mastery values
        randomizedListSequences = new List <SequenceTerm> (); //can remove from this list once mastered

        //parsing

        for (int i = 0; i < matrixOfCSVData.Count; i++)           //fill out list of Sequence class instances
        {
            SequenceTerm tempSequence = new SequenceTerm();
            tempSequence.initIndex      = i;
            tempSequence.arrayOfStrings = matrixOfCSVData[i];
            allTerms.Add(tempSequence);
        }
        for (int i = 0; i < allTerms.Count; i++)
        {
            totalMastery += requiredMastery;
        }

        PropagateMastery(assignToUse);

        List <SequenceTerm> tempListSequences = new List <SequenceTerm>(allTerms);        //copy list

        while (tempListSequences.Count > 0)                                               //shuffle list
        {
            int randomIndex = Mathf.FloorToInt(Random.Range(0, tempListSequences.Count)); //r.Next(0, inputList.Count); //Choose a random object in the list
            randomizedListSequences.Add(tempListSequences[randomIndex]);                  //add it to the new, random list
            tempListSequences.RemoveAt(randomIndex);                                      //remove to avoid duplicates
        }
        CheckForSequenceMastery();

        readyToConfigure = true;
    }
Ejemplo n.º 2
0
    public void configureGame(int thisInt)
    {
        submitButton       = GameObject.Find("SubmitButton");    //TODO GET RID OF ALL .FINDS
        scaleFactor        = GameObject.Find("Canvas").GetComponent <Canvas> ().scaleFactor;
        greenCheck         = GameObject.Find("greenCheck").GetComponent <PopUpGraphic> ();
        draggableGUIHolder = GameObject.Find("DraggableGUIHolder");
        redX = GameObject.Find("redX").GetComponent <PopUpGraphic> ();
        Input.multiTouchEnabled = true;


        assignIndex = thisInt;
        Assignment assignToUse = AppManager.s_instance.currentAssignments[assignIndex];

        useImages = AppManager.s_instance.currentAssignments[assignIndex].hasImages;
        if (useImages)
        {
            directoryForAssignment = AppManager.s_instance.currentAssignments[assignIndex].imgDir;
        }
        contentForAssign = AppManager.s_instance.currentAssignments[assignIndex].content;

        //parse CSV
        useImages = AppManager.s_instance.currentAssignments[assignIndex].hasImages;
        if (useImages)
        {
            directoryForAssignment = AppManager.s_instance.currentAssignments[assignIndex].imgDir;
        }

        //list init
        allTerms = new List <SequenceTerm> ();        //use this to store per SequenceTerm mastery values
        allTerms = convertCSV(parseContent(AppManager.s_instance.currentAssignments[assignIndex].content));

        //parse CSV
        useImages = AppManager.s_instance.currentAssignments[assignIndex].hasImages;
        if (useImages)
        {
            directoryForAssignment = AppManager.s_instance.currentAssignments[assignIndex].imgDir;
        }
        for (int i = 0; i < allTerms.Count; i++)
        {
            totalMastery += requiredMastery;
        }

        PropagateMastery(assignToUse);
        readyToConfigure = true;
    }
Ejemplo n.º 3
0
    public void configureGame(int thisInt)
    {
        submitButton = GameObject.Find ("SubmitButton"); //TODO GET RID OF ALL .FINDS
        scaleFactor = GameObject.Find ("Canvas").GetComponent<Canvas> ().scaleFactor;
        greenCheck = GameObject.Find ("greenCheck").GetComponent<PopUpGraphic> ();
        draggableGUIHolder = GameObject.Find ("DraggableGUIHolder");
        redX = GameObject.Find ("redX").GetComponent<PopUpGraphic> ();
        Input.multiTouchEnabled = true;

        assignIndex = thisInt;
        Assignment assignToUse = AppManager.s_instance.currentAssignments[assignIndex];
        useImages = AppManager.s_instance.currentAssignments[assignIndex].hasImages;
        if(useImages){
            directoryForAssignment = AppManager.s_instance.currentAssignments[assignIndex].imgDir;
        }
        contentForAssign = AppManager.s_instance.currentAssignments[assignIndex].content;

        //parse CSV
        useImages = AppManager.s_instance.currentAssignments[assignIndex].hasImages;
        if(useImages){
            directoryForAssignment = AppManager.s_instance.currentAssignments[assignIndex].imgDir;
        }

        //list init
        allTerms = new List<SequenceTerm> (); //use this to store per SequenceTerm mastery values
        allTerms = convertCSV(parseContent(AppManager.s_instance.currentAssignments[assignIndex].content));

        //parse CSV
        useImages = AppManager.s_instance.currentAssignments[assignIndex].hasImages;
        if(useImages){
            directoryForAssignment = AppManager.s_instance.currentAssignments[assignIndex].imgDir;
        }
        for (int i = 0; i < allTerms.Count; i++) {
            totalMastery+=requiredMastery;
        }

        PropagateMastery(assignToUse);
        readyToConfigure = true;
    }