Пример #1
0
    void Awake()
    {
        selected = "";
        PlayerMeta player = BaseSaver.GetPlayer();

        BoardMeta[] boards = BaseSaver.GetBoards();
        destSave = new List <string>(player.stats.dests);
        if (boards == null)
        {
            //SceneManager.LoadScene("ScrollingTextScene");
            Dictionary <string, BoardMeta> bMet = MapStatic.ReturnTestBoardDests(player.world == GameMeta.World.tutorial);
            List <BoardMeta> bList = new List <BoardMeta>();
            foreach (string key in bMet.Keys)
            {
                bList.Add(bMet[key]);
            }
            BaseSaver.PutBoards(bList.ToArray());
        }
        if (GameMeta.GameEnded())
        {
            SceneManager.LoadScene("ScrollingTextScene");
        }
        else if (GameMeta.RosterNeedsUpgrade())
        {
            SceneManager.LoadScene("TechScene");
        }

        ChangeDests(w0Dests, false);
        ChangeDests(w1Dests, false);
        ChangeDests(w2Dests, false);
        ChangeDests(w3Dests, false);
        ChangeDests(w4Dests, false);
        descPnl.SetActive(false);

        float time = player.stats.dests.Length == 1 ? 2 : .8f;

        switch (player.world)
        {
        case GameMeta.World.mountain:
            StartCoroutine(ZoomScale(new Vector3(850, -175, 0), w2Dests, time));
            break;

        case GameMeta.World.pyramid:
            StartCoroutine(ZoomScale(new Vector3(-600, -175, 0), w3Dests, time));
            break;

        case GameMeta.World.candy:
            StartCoroutine(ZoomScale(new Vector3(-600, 225, 0), w4Dests, time));
            break;

        case GameMeta.World.tutorial:
            StartCoroutine(ZoomScale(new Vector3(850, 225, 0), w0Dests, time));
            break;

        default:
            StartCoroutine(ZoomScale(new Vector3(850, 225, 0), w1Dests, time));
            break;
        }
    }
Пример #2
0
    public void RefreshSelect()
    {
        if (GameMeta.RosterNeedsUpgrade())
        {
            buttonImg.color = new Color(1, .35f, .35f);
        }
        else
        {
            buttonImg.color = Color.white;
        }
        foreach (Transform child in chrSelect.transform)
        {
            Destroy(child.gameObject);
        }
        player = BaseSaver.GetPlayer();
        List <Unit> units = new List <Unit>(player.characters.Reverse());

        for (int i = 0; i < units.Count; i++)
        {
            PopulateRw(units[i], i);
        }
        if (units.Count > 3)
        {
            inactive.SetActive(true);
            List <Unit> inact = new List <Unit>();
            for (int i = 3; i < units.Count; i++)
            {
                inact.Add(units[i]);
            }
            inactive.transform.GetChild(0).GetComponent <TextMeshProUGUI>().text = ClassNode.GetClassBonusString(inact.ToArray());
        }
        else
        {
            inactive.SetActive(false);
        }
    }