Esempio n. 1
0
    public void SelectObject(int i)
    {
        //Select object and store that it was selected also store which one was selected.
        //For possibly extending this later on.
        if (!bAnySelection)
        {
            //smth has been selected, don't let select again unless restart.
            bAnySelection = true;
            //Mark object as selected.
            bObjectSelected[i] = true;
            Debug.Log("There was a selection, selection locked");

            //Checks to see if the selected object is the set as correct one.
            if (i == IndexOfCorrectObject)
            {
                bCorrectSlection = true;
                cupboardTask.CmdSetTaskSuccess(bCorrectSlection);
                Debug.Log("Correct Selection");
                cupboardTask.ReturnMovementToPlayerOnUI();
                cupboardTask.CmdSetCompleted(true);
                this.gameObject.SetActive(false);
            }
            else
            {
                Debug.Log("Wrong Selection");
                cupboardTask.CmdSetTaskSuccess(bCorrectSlection);
                cupboardTask.ReturnMovementToPlayerOnUI();
                cupboardTask.CmdSetCompleted(true);
                this.gameObject.SetActive(false);
            }
        }
        Debug.Log("SelectObject called but selection is locked");
    }
Esempio n. 2
0
 public void RestartMinigame()
 {
     for (int a = 0; a < Tools.Length; a++)
     {
         Tools[a].GetComponent <Button>().interactable = true;
     }
     iSelectedTool     = 10;
     bHaveTool         = false;
     bCorrectAnswere   = false;
     currentPorcentage = 1;
     baseTask.CmdSetTaskSuccess(bCorrectAnswere);
 }
Esempio n. 3
0
 public void FinishMinigame()
 {
     potionsTask.CmdSetTaskSuccess(bWin);
     this.gameObject.SetActive(false);
     potionsTask.CmdSetCompleted(true);
     potionsTask.ReturnMovementToPlayerOnUI();
 }
Esempio n. 4
0
    public void StopCooling()
    {
        CoolingRate = 0.0f;

        buttonHeatUp.interactable      = false;
        buttonIngredients.interactable = false;
        BaseTask.CmdSetTaskSuccess(CheckIfTemperatureIsCorrect());
        BaseTask.ReturnMovementToPlayerOnUI();
        BaseTask.CmdSetCompleted(true);
        this.gameObject.SetActive(false);
        //CheckIfTemperatureIsCorrect()
    }
Esempio n. 5
0
 public void StopRune(int r)
 {
     runes[r].GetComponent <Button>().interactable = false;
     bStopFalling[r] = true;
     bSelected[r]    = true;
     indexResult++;
     if (indexResult == 3)
     {
         if (bSelected[0] && bSelected[2] && bSelected[4])
         {
             baseTask.CmdSetTaskSuccess(true);
             baseTask.ReturnMovementToPlayerOnUI();
             this.gameObject.SetActive(false);
             baseTask.CmdSetCompleted(true);
         }
         else
         {
             baseTask.CmdSetTaskSuccess(false);
             baseTask.ReturnMovementToPlayerOnUI();
             this.gameObject.SetActive(false);
             baseTask.CmdSetCompleted(true);
         }
     }
 }