void CallMethod(MethodName name) { if (_hasMethod[(int)name]) { CellLuaManager.ClassCallMethod(LuaClassName, name.ToString(), gameObject); } }
public void RegisterMessage(string msgName, LuaFunction func) { _dispatcher.Add(StringUtility.Hash(msgName), (obj) => { CellLuaManager.NetworkDecodeRecv(this, msgName, obj as MemoryStream, func); }); }
public void InitAwake(string className) { LuaClassName = className; CellLuaManager.Attach(); _hasMethod = CellLuaManager.ClassHasMethod(LuaClassName); CallMethod(MethodName.Awake); }
void OnDestroy() { CellLuaManager.Detach(); }
void Awake( ) { CellLuaManager.Attach(); }
void OnDestroy( ) { CallMethod(MethodName.OnDestroy); CellLuaManager.Detach(); }