Пример #1
0
    public void AddSkill(PlayerSkill skill)
    {
        PlayerSkill copy = skill.CreateCopy();

        skills.Add(copy);
        copy.Init(this);
        eSkillChange.Invoke();
    }
Пример #2
0
    public void Init()
    {
        //1. 拿到技能数据
        skillDataList = GameController.Instance.playerData.SkillList;

        //2. 完成playerskill的初始化
        for (int i = 0; i < skillDataList.Count; i++)
        {
            PlayerSkill playerskill = transform.Find("Skill" + (i + 1)).GetComponent <PlayerSkill>();
            playerskill.Init(skillDataList[i], this);

            //3.将 playerskill 添加到字典
            playerSkillDic.Add(skillDataList[i].Id, playerskill);
        }
    }