Ejemplo n.º 1
0
    //TODO Make this smarter, by using TownController, etc.
    public void OnSceneLoaded(Scene scene, LoadSceneMode mode)
    {
        Debug.Log("level: " + scene.name);
        if (scene.buildIndex == 1)
        {
            PartyController partyController = FindObjectOfType <PartyController>();
            StartCoroutine(partyController.SetupParty(playerHeroInfo.party));
        }

        if (scene.buildIndex == 0)
        {
            Debug.Log("Town loaded");

            //TODO if the unit is in the party, don't add it to available, but still create the hero panel
            FindObjectOfType <HeroListUI>().SetupList();
            FindObjectOfType <PartyFrameController>().SetupParty(playerHeroInfo.party);

            unitInfoChanged();
        }
    }