miduo_client/Assets/ManagedResources/~Lua/Modules/GlobalActTimeCtrl/FuncOpenClass.lua

46 lines
1.1 KiB
Lua

---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by Steven Hawking.
--- DateTime: 2019/11/1 11:51
--- if you wanna use this shit then Please Create the Text by use this class
CreateNewText = {}
local CreateAsset = function(scale, localPos, parent)
local textItem = poolManager:LoadAsset("NewItem", PoolManager.AssetType.GameObject)
if parent then
textItem.transform:SetParent(parent.transform)
end
textItem.transform.localScale = scale
textItem.transform.localPosition = localPos
return textItem
end
function CreateNewText:New(scale, localPos, parent)
local _o = {}
_o = {} or _o
setmetatable(_o, self)
self.__index = self
-- 创建成员
_o.textItem = CreateAsset(scale, localPos, parent)
return _o
end
function CreateNewText:PlayAnim()
if self.textItem then
PlayUIAnim(self.textItem)
end
end
function CreateNewText:UnLoadTextItem()
if self.textItem then
poolManager:UnLoadAsset("NewItem", self.textItem, PoolManager.AssetType.GameObject)
self.textItem = nil
end
end
return CreateNewText