예제 #1
0
    private void Awake()
    {
        List <string> selectedUnitIds = StaticData.SelectedUnits;

        for (int i = 0; i < selectedUnitIds.Count; i++)
        {
            string   unitId   = selectedUnitIds[i];
            UnitData unitData = unitSaveManager.LoadUnitData(unitId);
            unitSelectionPanel.CreateSelectedUnitSlot(unitData);
            unitDataList.Add(unitData);
        }

        unitSelectionPanel.OnSlotLeftClickEvent += OnChoosingUnit;

        changeSceneManger.gameObject.SetActive(true);
    }
예제 #2
0
    private void Awake()
    {
        _unlockedCharacters = JObject.Parse(File.ReadAllText(_unlockedCharactersPath));
        _abilityConfig      = JObject.Parse(File.ReadAllText(_abilityConfigPath));

        string[] unlockedCharacterIds = _unlockedCharacters["unlocked"].ToObject <string[]>();
        limit          = StaticData.LevelInformation.GetNumPlayers();
        limitText.text = "             /" + limit + " units";
        unitSelectionPanel.OnSlotLeftClickEvent  += OnToggleSelectUnit;
        unitSelectionPanel.OnSlotMouseEnterEvent += OnToggleUnitStats;

        for (int i = 0; i < unlockedCharacterIds.Length; i++)
        {
            string   unitId   = unlockedCharacterIds[i];
            UnitData unitData = unitSaveManager.LoadUnitData(unitId);
            unitSelectionPanel.CreateUnitSelectionSlot(unitData);
        }
    }