Пример #1
0
    private void LevelWon(List <GameObject> correctPath)
    {
        SetPuzzleStatusText(true);
        puzzleBeaten = true;
        actionController.GetComponent <ActionControllerScript>().DisableActions();

        if (gameObject.GetComponent <HighlightPathScript>() == null)
        {
            gameObject.AddComponent <HighlightPathScript>();
            gameObject.GetComponent <HighlightPathScript>().correctPath   = correctPath;
            gameObject.GetComponent <HighlightPathScript>().otherOctagons = GetOtherOctagons(correctPath);
        }

        resetButton.GetComponent <Button>().interactable = false;
        timerRef.GetComponent <TimeUpdaterScript>().Pause();

        SetupWinDialog();

        if (HintSystem.UserGetsAnotherHint(CurrentPuzzleName, CurrentPuzzleCategory))
        {
            HintSystem.IncrementHints(1);
            winDialogHintsText.gameObject.SetActive(true);
        }

        SaveCompletedLevel();
        ProcessCelebratoryText();
    }
Пример #2
0
    private void Awake()
    {
        instance = this;

        mainCubes  = FindObjectsOfType <MainCube>();
        targetList = FindObjectsOfType <Target>();
    }
Пример #3
0
    public void ShowHint()
    {
        var correctPathOctagonsNotCorrected = OctagonsList.Where(x => x.GetComponent <OctagonControllerScript>().octagonType == Enumerations.OctagonType.CorrectPath &&
                                                                 x.GetComponent <OctagonControllerScript>().IsCorrect == false).ToList();

        if (HintSystem.GetAvailableHints() <= 0)
        {
            return;             // CHANGE THIS TO A WAY TO GET MORE HINTS
        }
        // If there are no more octagons to show correctly or there are no available hints
        if (correctPathOctagonsNotCorrected.Count == 0)
        {
            return;
        }

        // Get a correct path octagon that hasn't already been made into a hint
        var randomInt        = UnityEngine.Random.Range(0, correctPathOctagonsNotCorrected.Count);  // 2nd parameter of random.range is exlcusive so no - 1
        var octagonToCorrect = correctPathOctagonsNotCorrected[randomInt];

        octagonToCorrect.GetComponent <OctagonControllerScript>().CorrectRotationFromHint();

        actionController.GetComponent <ActionControllerScript>().IncreaseActionCountByValue(1);
        HintSystem.DecrementHints(1);
        hintButton.transform.Find("Text").GetComponent <Text>().text = "Hint: " + HintSystem.GetAvailableHints();
    }
Пример #4
0
 private void Start()
 {
     SetNewSpawnPoint(); //...
     hintSystem = FindObjectOfType <HintSystem>();
     canvas     = this.GetComponentInChildren <Canvas>();
     canvas.gameObject.SetActive(false);
 }
Пример #5
0
    public void StoreDragData(string dragData)
    {
        currLevelData.AddDragLog(dragData);

        HintSystem hintSystem = FindObjectOfType <HintSystem>();

        if (hintSystem != null)
        {
            hintSystem.AddDragInfo(dragData);
        }
        FindObjectOfType <DragCounter>().DraggedOnce();
    }
Пример #6
0
        string GetHintString()
        {
            HintSystem weakInstance = HintSystem.WeakInstance;

            if (weakInstance != null)
            {
                HintSystem.HintData currentHint = weakInstance.GetCurrentHint();
                if (currentHint != null)
                {
                    return(currentHint.String);
                }
            }
            return(base.Owner._defaultHintStr);
        }
Пример #7
0
    private void ResetLevelToDefaults()
    {
        //winDialog.transform.Find("CanvasGroup").gameObject.SetActive(false);
        winDialog.GetComponent <Animator>().SetBool("Show", false);
        resetButton.GetComponent <Button>().interactable = true;
        SetPuzzleStatusText(false);
        actionController.GetComponent <ActionControllerScript>().Reset();
        actionController.GetComponent <ActionControllerScript>().EnableActions();
        timerRef.GetComponent <TimeUpdaterScript>().ResetTimer();
        timerRef.GetComponent <TimeUpdaterScript>().Resume();

        var x = winDialog.transform.Find("CanvasGroup").Find("NextButton").gameObject;

        x.GetComponent <Button>().interactable = true;
        x.transform.Find("Text").GetComponent <Text>().text = "Next Puzzle";

        PlayerPrefs.SetString("PuzzleName", PuzzleList[currentPuzzleIterator].PuzzleName);

        puzzleBeaten = false;
        adController.GetComponent <InterstitialAdScript>().PrepareInterstitalAd();
        hintButton.transform.Find("Text").GetComponent <Text>().text = "Hint: " + HintSystem.GetAvailableHints();
        winDialogHintsText.gameObject.SetActive(false);
    }
Пример #8
0
 private void Awake()
 {
     instance = this;
 }
 // Use this for initialization
 void Start()
 {
     PuzzlePersistence.Load();
     SettingsPersistence.Load();
     HintSystem.InitializeFirstTimeHintSystem();
 }