UIBase = class("UIBase")
UIBase.State = UIState.Created
UIBase.gameObject = nil
UIBase.transform = nil
function UIBase:ctor( obj )
-- body
self.PanelData= {}
self.State = UIState.Created
self.gameObject = obj
self.transform = self.gameObject.transform
self.luabehaviour = self.transform.gameObject:GetComponent(LuaBehaviour.GetClassType())
end
UIBase.gameObject = nil
UIBase.transform = nil
function UIBase:ctor( obj )
-- body
self.PanelData= {}
self.State = UIState.Created
self.gameObject = obj
self.transform = self.gameObject.transform
self.luabehaviour = self.transform.gameObject:GetComponent(LuaBehaviour.GetClassType())
end
------------------
UIBase = class("UIBase")
UIBase.State = UIState.Created
UIBase.gameObject = nil
UIBase.transform = nil
UIBase.PanelData= {}
UIBase.gameObject = nil
UIBase.transform = nil
function UIBase:ctor( obj )
-- body
self.State = UIState.Created
self.gameObject = obj
self.transform = self.gameObject.transform
self.luabehaviour = self.transform.gameObject:GetComponent(LuaBehaviour.GetClassType())
end
这两个写法不同之处是 当生成多个UIBase对象时候 PanelData一个是静态变量一个是实例变量