26 lines
556 B
Plaintext
26 lines
556 B
Plaintext
|
|
|
|
CommonAwardItem = CommonAwardItem or BaseClass()
|
|
|
|
local itemGo
|
|
local defaultPath = "ui/commonawarditem"
|
|
|
|
function CommonAwardItem.__init(item, prefab, parent)
|
|
|
|
local function OnLoadFinish(name, go, hashParam)
|
|
if go ~= nil then
|
|
itemGo = go
|
|
if parent ~= nil then
|
|
go.transform:SetParent(parent)
|
|
end
|
|
end
|
|
end
|
|
|
|
if prefab ~= nil then
|
|
local go = CS.UnityEngine.Object.Instantiate(prefab)
|
|
go:SetActive(true)
|
|
OnLoadFinish(go.name, go)
|
|
else
|
|
CS.LoadAssetBundle.Instance:LoadGameObject("ui/", "CommonAwardItem", OnLoadFinish, {})
|
|
end
|
|
end |