Skip to content

@package usage #1682

Closed Answered by sumneko
carsakiller asked this question in Q&A
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
Category
Q&A
Labels
documentation Has to do with documentation either in the wiki or in the repo
2 participants