Example #1
0
 private void CheckForMaxPointsReached()
 {
     if (SlicedMelonCounter >= ammountOfPointsToWin && ammountOfPointsToWin <= 0)
     {
         Debug.LogError("AmmountOfPointsToWin not set, it's currently " + ammountOfPointsToWin);
     }
     else if (SlicedMelonCounter >= ammountOfPointsToWin)
     {
         UIManager.Instance.LevelClearedScreen();
         UIManager.Instance.melonCounterToBeDisabledOnLvLClear.SetActive(false);
         blade.GetComponent <CircleCollider2D>().enabled = false;
     }
 }
 private void Update()
 {
     DisplayInventoryAmount();
     if (nodesDone >= numNodes)
     {
         nodesDone = 0;
     }
     timer += Time.deltaTime;
     if (timer >= 1f)
     {
         timer = 0;
         progressBar.fillAmount -= 0.01f;
     }
     if (progressBar.fillAmount < 0)
     {
         progressBar.fillAmount = 0;
     }
     if (progressBar.fillAmount >= 1)
     {
         ResetAll();
         CloseSpellbook();
         pData.magicSpells[currentSpell].amount++;
     }
     if (!bladeLineScript.GetComponent <CircleCollider2D>().isActiveAndEnabled)
     {
         progressBar.fillAmount = 0;
         for (int i = 0; i < initialNodes.Length; i++)
         {
             initialNodes[i].SetActive(true);
         }
         for (int i = 0; i < midNodes.Length; i++)
         {
             midNodes[i].SetActive(false);
         }
         nodesDone = 0;
     }
 }