Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (partyIsInFightMode == false)
     {
         currentCorridorId = dungeonsGenerator.getIdOfCorridor();
         checkIfThereShouldBeAFight(currentCorridorId);
     }
 }
Exemplo n.º 2
0
    public void doorTransition()
    {
        if (!shouldButtonsBeLocked)
        {
            currentCorridorId = dungeonGenerator.getIdOfCorridor();
            currentCorridor   = dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == currentCorridorId);

            //Here we're calling popup to allow user to pick next corridor
            //For that we're going to send our current corridor id
            if (focusedHeroPosition >= 0 && focusedHeroPosition <= 7)
            {
                if (currentCorridorId == 0)
                {
                    GameSave.Instance.SceneIndex = GameGlobals.SceneIndex.CityScene;
                    GameSave.Instance.Update();
                    SceneManager.LoadScene((int)GameSave.Instance.SceneIndex);
                }
                else
                {
                    Debug.Log("ButtonForUsage || doorTransition || Registered use on entrance door!");
                    chooseCorridor.showCorridorDecissionPopup(previousCorridorId);
                    shouldButtonsBeLocked = true;
                    typeOfLoadingLevel    = 1;
                }
            }
            else if (focusedHeroPosition >= ((currentCorridor.getNumberOfChunks() - 1) * 7) && focusedHeroPosition <= ((currentCorridor.getNumberOfChunks()) * 7))
            {
                Debug.Log("ButtonForUsage || doorTransition || Registered use on exit doors!");
                chooseCorridor.showCorridorDecissionPopup(currentCorridorId);
                shouldButtonsBeLocked = true;
                typeOfLoadingLevel    = 0;
            }


            Debug.Log("ButtonForUsage || doorTransition || (" + focusedHeroPosition + " >= " + ((currentCorridor.getNumberOfChunks() - 1) * 7) + " && " + focusedHeroPosition + " <= " + (currentCorridor.getNumberOfChunks() * 7) + ")");
            Debug.Log("ButtonForUsage || doorTransition || CurrentCorridorNumber is: " + currentCorridorId);
        }
        else
        {
            Debug.Log("ButtonForUsage || doorTransition || Buttons are locked!");
        }
    }