Example #1
0
    public void Show()
    {
        UpdateArmy();
        Person person = Person;

        icon.sprite = person.icon;
        int i;

        for (i = 0; i < person.Skills.Length; i++)
        {
            Skill       skill  = person.Skills[i];
            SkillButton button = skillsButton[i];
            button.gameObject.SetActive(true);
            button.RemoveAllListeners();
            button.AddListener(() => skill.Cast());
            button.AddListener(() => UpdatePropertyAndSkills());
            int j = i;
            button.AddUpgradeListener(() => person.LearnSkill(j));
            button.AddUpgradeListener(() => UpdatePropertyAndSkills());
            button.SetSkill(skill, (s) => s.Person.lvlPoint > 0 && s.GetLevel != s.GetMaxLevel);
        }
        for (; i < skillsButton.Length; i++)
        {
            skillsButton[i].gameObject.SetActive(false);
        }
        name.text = person.name;
        UpdatePropertyAndSkills();
    }
    static int SetSkill(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        SkillButton obj = (SkillButton)LuaScriptMgr.GetUnityObjectSelf(L, 1, "SkillButton");

        OneByOne.FightSkill arg0 = (OneByOne.FightSkill)LuaScriptMgr.GetNetObject(L, 2, typeof(OneByOne.FightSkill));
        obj.SetSkill(arg0);
        return(0);
    }