Skip to content
Discussion options

You must be logged in to vote

Packaged field is only visible in the same file

---@class unit
---@field package _skillMgr SkillManager --> inject a private field, used for component mode
local mt = GetClass('unit')

---@param skillName string
function mt:AddSkillByName(skillName)
    if not self._skillMgr then
        self._skillMgr = New('SkillManager', self)
    end
    return self._skillMgr:AddSkillByName(skillName)
end

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by carsakiller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Has to do with documentation either in the wiki or in the repo
2 participants