Exemple #1
0
            public void OnSelectSkill(int selectID)
            {
                if (selectID == 0)
                {
                    skill    = null;
                    maxLevel = 0;
                }
                else
                {
                    skill       = new Skill();
                    skill.title = dropdown.options[selectID].text;
                    skill.level = 1;
                    maxLevel    = SkillDatas.GetSkillDataBySkill(skill).maxLevel;
                }

                RefreshUI();
            }
Exemple #2
0
        public void Start()
        {
            SkillDatas.Init();
            EquipDatas.Init();

            //Skill
            List <Dropdown.OptionData> skillOptions = new List <Dropdown.OptionData>();

            skillOptions.Add(new Dropdown.OptionData(@"空"));
            foreach (var skill in SkillDatas.GetSkillDatas())
            {
                skillOptions.Add(new Dropdown.OptionData(skill.Key));
            }
            foreach (var skillUI in skillUIs)
            {
                skillUI.dropdown.options = skillOptions;
                skillUI.dropdown.onValueChanged.AddListener(skillUI.OnSelectSkill);
                skillUI.add.onClick.AddListener(skillUI.OnAddLevel);
                skillUI.minus.onClick.AddListener(skillUI.OnMinusLevel);
                skillUI.skill = null;
                skillUI.RefreshUI();
            }

            //Stone
            List <Dropdown.OptionData> stoneOptions = new List <Dropdown.OptionData>();

            stoneOptions.Add(new Dropdown.OptionData(@"空"));
            foreach (var equip in EquipDatas.GetEquipDatas()[EquipType.Stone])
            {
                stoneOptions.Add(new Dropdown.OptionData(equip.Key));
            }
            stoneUI.dropdown.options = stoneOptions;
            stoneUI.dropdown.onValueChanged.AddListener(stoneUI.OnSelectStone);
            stoneUI.stone = null;

            //Decoration
            List <Dropdown.OptionData> decorationOptions = new List <Dropdown.OptionData>();

            decorationOptions.Add(new Dropdown.OptionData(@"空"));
            foreach (var equip in EquipDatas.GetEquipDatas()[EquipType.Decoration])
            {
                decorationOptions.Add(new Dropdown.OptionData(equip.Key));
            }
            decorationUI.dropdown.options = decorationOptions;
            decorationUI.dropdown.onValueChanged.AddListener(decorationUI.OnSelectDecoration);
            decorationUI.add.onClick.AddListener(decorationUI.OnAdd);
            decorationUI.decoration      = null;
            decorationUI.decorationItems = new List <DecorationUI.DecorationItem>();
            decorationUI.RefreshUI();

            //Search
            searchUI.onClick.AddListener(OnSearch);

            //Dialog
            resultDialog.GetComponentInChildren <Button>().onClick.AddListener(OnDialogConfirm);
            resultDialog.gameObject.SetActive(false);

            //Suit
            suitUI.skillUIs = skillUIs;
            suitUI.suitsSelection.onValueChanged.AddListener(suitUI.OnSelectSuit);
            suitUI.selectedSuit = null;
            suitUI.suits        = new List <Suit>();
            suitUI.RefreshSelection();
        }