示例#1
0
 //! --------functions--------
 public static void Subscribe(TagName tag, OnFree handler)
 {
     if (_handlers.ContainsKey(tag))
     {
         _handlers[tag] += handler;
     }
     else
     {
         _handlers.Add(tag, handler);
     }
 }
示例#2
0
 public new void Enqueue(T obj)
 {
     base.Enqueue(obj);
     lock (this._object) {
         while (this.Count > this.Size)
         {
             if (this.TryDequeue(out var outObj))
             {
                 OnFree?.Invoke(outObj);
             }
         }
     }
 }
 public void Clear()
 {
     LuaOnInit              = null;
     LuaOnFree              = null;
     LuaOnUpdate            = null;
     LuaOnEnter             = null;
     LuaOnExit              = null;
     LuaPause               = null;
     LuaOnResume            = null;
     LuaOnAnimationStart    = null;
     LuaOnAnimationComplete = null;
     LuaOnEventTrigger      = null;
     LuaOnColliderTrigger   = null;
 }
示例#4
0
 public new void Enqueue(T obj)
 {
     base.Enqueue(obj);
     lock (_object)
     {
         while (Count > Size)
         {
             if (TryDequeue(out var outObj))
             {
                 OnFree?.Invoke(outObj);
             }
         }
     }
 }
 public void Bind(string luaName)
 {
     LuaOnInit              = GameMode.XLua.GetInPath <OnInit>($"{luaName}.OnInit");
     LuaOnFree              = GameMode.XLua.GetInPath <OnFree>($"{luaName}.OnFree");
     LuaOnUpdate            = GameMode.XLua.GetInPath <OnUpdate>($"{luaName}.OnUpdate");
     LuaOnEnter             = GameMode.XLua.GetInPath <OnEnter>($"{luaName}.OnEnter");
     LuaOnExit              = GameMode.XLua.GetInPath <OnExit>($"{luaName}.OnExit");
     LuaPause               = GameMode.XLua.GetInPath <OnPause>($"{luaName}.OnPause");
     LuaOnResume            = GameMode.XLua.GetInPath <OnResume>($"{luaName}.OnResume");
     LuaOnAnimationStart    = GameMode.XLua.GetInPath <OnAnimationStart>($"{luaName}.OnAnimationStart");
     LuaOnAnimationComplete = GameMode.XLua.GetInPath <OnAnimationComplete>($"{luaName}.OnAnimationComplete");
     LuaOnEventTrigger      = GameMode.XLua.GetInPath <OnEventTrigger>($"{luaName}.OnEventTrigger");
     LuaOnColliderTrigger   = GameMode.XLua.GetInPath <OnColliderTrigger>($"{luaName}.OnColliderTrigger");
 }