Пример #1
0
    private void CheckNextObjectiveSetup(string nextObj)
    {
        string[] objSplit = nextObj.Split('>');
        string   type     = objSplit[0].Trim();

        currentTask = type;
        switch (type)
        {
        case "build":
            partialCreated = false;
            getAnswer      = false;
            SM.LevelChecking(false);
            APMultiple.Disappear();
            APSingle.Appear(); //make control panel with buttons appear
            PS.StartMovesCounter();
            CheckMininumMoves(objSplit[1].Trim());
            break;

        case "complete":
            partialCreated = true;
            getAnswer      = false;
            SM.LevelChecking(false);
            partialName = GetPartialMolecule(objSplit[1].Trim());
            CheckMininumMoves(objSplit[1].Trim());
            //partialGO = manager.LoadMolecule(partialName, false);
            APMultiple.Disappear();
            APSingle.Appear(); //make control panel with buttons appear
            PS.StartMovesCounter();
            break;

        case "transform":
            partialCreated = true;
            getAnswer      = false;
            SM.LevelChecking(false);
            partialName = objSplit[2].Trim();
            //partialGO = manager.LoadMolecule(objSplit[2].Trim(), false);
            APMultiple.Disappear();
            APSingle.Appear(); //make control panel with buttons appear
            CheckMininumMoves(objSplit[1].Trim());
            PS.StartMovesCounter();
            break;

        case "load":
            partialCreated = false;
            SM.LevelChecking(true);
            APMultiple.Disappear();
            APSingle.Appear(); //make control panel with buttons appear
            break;

        case "save":
            partialCreated = false;
            SM.LevelChecking(false);
            APMultiple.Disappear();
            APSingle.Appear(); //make control panel with buttons appear
            break;

        case "place":
            partialCreated = false;
            manager.LoadMolecule(objSplit[1].Trim() + "_place", false);
            SM.LevelChecking(false);
            break;

        case "multiple choice":
            partialCreated = true;
            partialName    = objSplit[2].Trim();
            //partialGO = manager.LoadMolecule(partialName, false);
            SM.LevelChecking(false);
            APSingle.Disappear();
            APMultiple.Appear(); //make control panel with buttons appear
            PS.StartAnswersCounter();
            getAnswer = true;
            break;
        }
    }
Пример #2
0
    public static void CheckObjectiveComplete()
    {
        string obj = phasesObjectives[phase][objective];

        string[] objSplit = obj.Split(' ');
        switch (objSplit[0])
        {
        case "grab":
            if (objSplit[1].Trim() == "atom")
            {
                if (atomsGrabbed == 1)
                {
                    lastObjective = objSplit[1];
                    objective++;
                }
            }
            else if (objSplit[1].Trim() == "atoms")
            {
                if (atomsGrabbed == 2)
                {
                    lastObjective = objSplit[1];
                    objective++;
                }
            }
            else if (objSplit[1].Trim() == "gear")
            {
                if (pivotGrabbed)
                {
                    lastObjective = objSplit[1];
                    objective++;
                }
            }
            break;

        case "touch":
            if (atomsTouched)
            {
                objective++;
            }
            break;

        case "move":
            if (moleculeRotated)
            {
                objective++;
            }
            break;

        case "let":
            if (atomsGrabbed == 0)
            {
                objective++;
            }
            break;

        case "bond":
            if (bondCreated)
            {
                objective++;
            }
            break;

        case "separate":
            if (bondBroken)
            {
                objective++;
            }
            break;
        }
        if (objective >= phasesObjectives[phase].Count)
        {
            phase++;
            objective = 0;
        }
        if (atomsTouched)
        {
            atomsTouched = false;
        }
        if (bondCreated)
        {
            bondCreated = false;
        }
        if (pivotGrabbed)
        {
            pivotGrabbed = false;
        }
        if (moleculeRotated)
        {
            moleculeRotated = false;
        }
        if (bondBroken)
        {
            bondBroken = false;
        }

        if (phase > phasesObjectives.Count && final)
        {
            string space = "\n" + "\n" + "\n";
            BBM.UpdateText(space + "Parabéns, terminaste o tutorial com sucesso!" + "\n" + "Carrega no botão que está em cima da mesa no lado esquerdo para voltares ao menu principal");
            APSingle = GameObject.Find("ControlPanelAnswer").GetComponent <AnswerPanel>();
            APSingle.Appear();
            final = false;
        }
        else
        {
            UpdateBoard();
        }
    }