public static void Add(List <EventDelegate> list, EventDelegate.Callback callback, bool oneShot) { if (list != null) { int i = 0; int count = list.Count; while (i < count) { EventDelegate eventDelegate = list[i]; if (eventDelegate != null && eventDelegate.Equals(callback)) { return; } i++; } list.Add(new EventDelegate(callback) { oneShot = oneShot }); } else { Debug.LogWarning("Attempting to add a callback to a list that's null"); } }
/// <summary> /// Append a new event delegate to the list. /// </summary> static public void Add(List <EventDelegate> list, EventDelegate ev, bool oneShot) { if (ev.mRawDelegate || ev.target == null || string.IsNullOrEmpty(ev.methodName)) { Add(list, ev.mCachedCallback, oneShot); } else if (list != null) { for (int i = 0, imax = list.Count; i < imax; ++i) { EventDelegate del = list[i]; if (del != null && del.Equals(ev)) { return; } } EventDelegate copy = new EventDelegate(ev.target, ev.methodName); copy.oneShot = oneShot; if (ev.mParameters != null && ev.mParameters.Length > 0) { copy.mParameters = new Parameter[ev.mParameters.Length]; for (int i = 0; i < ev.mParameters.Length; ++i) { copy.mParameters[i] = ev.mParameters[i]; } } list.Add(copy); } else { } }
public static EventDelegate Add(List <EventDelegate> list, EventDelegate.Callback callback, bool oneShot) { if (list == null) { Debug.LogWarning("Attempting to add a callback to a list that's null"); return(null); } int num = 0; int count = list.Count; while (num < count) { EventDelegate item = list[num]; if (item != null && item.Equals(callback)) { return(item); } num++; } EventDelegate eventDelegate = new EventDelegate(callback) { oneShot = oneShot }; list.Add(eventDelegate); return(eventDelegate); }
// Token: 0x0600039E RID: 926 RVA: 0x00021BB4 File Offset: 0x0001FDB4 public static void Add(List <EventDelegate> list, EventDelegate ev, bool oneShot) { if (ev.mRawDelegate || ev.target == null || string.IsNullOrEmpty(ev.methodName)) { EventDelegate.Add(list, ev.mCachedCallback, oneShot); return; } if (list != null) { int i = 0; int count = list.Count; while (i < count) { EventDelegate eventDelegate = list[i]; if (eventDelegate != null && eventDelegate.Equals(ev)) { return; } i++; } EventDelegate eventDelegate2 = new EventDelegate(ev.target, ev.methodName); eventDelegate2.oneShot = oneShot; if (ev.mParameters != null && ev.mParameters.Length != 0) { eventDelegate2.mParameters = new EventDelegate.Parameter[ev.mParameters.Length]; for (int j = 0; j < ev.mParameters.Length; j++) { eventDelegate2.mParameters[j] = ev.mParameters[j]; } } list.Add(eventDelegate2); return; } Debug.LogWarning("Attempting to add a callback to a list that's null"); }
public static EventDelegate Add(List <EventDelegate> list, EventDelegate ed, float shotInterval = 0f) { EventDelegate result; if (list != null) { for (int i = 0; i < list.Count; i++) { EventDelegate eventDelegate = list[i]; if (eventDelegate != null && eventDelegate.Equals(ed)) { result = eventDelegate; return(result); } } list.Add(ed); result = ed; } else { Debug.LogWarning("Attempting to add a callback to a list that's null"); result = null; } return(result); }
/// <summary> /// Append a new event delegate to the list. /// </summary> static public void Add(List <EventDelegate> list, EventDelegate ev, bool oneShot) { if (ev.mRawDelegate || ev.target == null || string.IsNullOrEmpty(ev.methodName)) { Add(list, ev.mCachedCallback, oneShot); } else if (list != null) { for (int i = 0, imax = list.Count; i < imax; ++i) { EventDelegate del = list[i]; if (del != null && del.Equals(ev)) { return; } } EventDelegate ed = new EventDelegate(ev.target, ev.methodName); ed.oneShot = oneShot; list.Add(ed); } else { Debug.LogWarning("Attempting to add a callback to a list that's null"); } }
public static void Add(List <EventDelegate> list, EventDelegate ev, bool oneShot) { if (ev.mRawDelegate || ev.target == null || string.IsNullOrEmpty(ev.methodName)) { EventDelegate.Add(list, ev.mCachedCallback, oneShot); } else if (list != null) { int i = 0; int count = list.Count; while (i < count) { EventDelegate eventDelegate = list[i]; if (eventDelegate != null && eventDelegate.Equals(ev)) { return; } i++; } list.Add(new EventDelegate(ev.target, ev.methodName) { oneShot = oneShot }); } else { LogSystem.LogWarning(new object[] { "Attempting to add a callback to a list that's null" }); } }
static int Equals(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 2); EventDelegate obj = LuaScriptMgr.GetVarObject(L, 1) as EventDelegate; object arg0 = LuaScriptMgr.GetVarObject(L, 2); bool o = obj != null?obj.Equals(arg0) : arg0 == null; LuaScriptMgr.Push(L, o); return(1); }
static public bool Remove(List <EventDelegate> list, Callback callback) { if (list != null) { for (int i = 0; i < list.Count; i++) { EventDelegate del = list[i]; if (del != null && del.Equals(callback)) { list.RemoveAt(i); return(true); } } } return(false); }
public static bool Remove(List <EventDelegate> list, EventDelegate ev) { if (list != null) { int i = 0; for (int count = list.Count; i < count; i++) { EventDelegate eventDelegate = list[i]; if (eventDelegate != null && eventDelegate.Equals(ev)) { list.RemoveAt(i); return(true); } } } return(false); }
static int Equals(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); EventDelegate obj = (EventDelegate)ToLua.CheckObject(L, 1, typeof(EventDelegate)); object arg0 = ToLua.ToVarObject(L, 2); bool o = obj != null?obj.Equals(arg0) : arg0 == null; LuaDLL.lua_pushboolean(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
/// <summary> /// Remove an existing event delegate from the list. /// </summary> static public bool Remove (List<EventDelegate> list, Callback callback) { if (list != null) { for (int i = 0, imax = list.Count; i < imax; ++i) { EventDelegate del = list[i]; if (del != null && del.Equals(callback)) { list.RemoveAt(i); return true; } } } return false; }
/// <summary> /// Remove an existing event delegate from the list. /// </summary> static public bool Remove(List <EventDelegate> list, EventDelegate ev) { if (list != null) { for (int i = 0, imax = list.Count; i < imax; ++i) { EventDelegate del = list[i]; if (del != null && del.Equals(ev)) { list.RemoveAt(i); return(true); } } } return(false); }
private static int Equals(IntPtr L) { int result; try { ToLua.CheckArgsCount(L, 2); EventDelegate eventDelegate = (EventDelegate)ToLua.CheckObject(L, 1, typeof(EventDelegate)); object obj = ToLua.ToVarObject(L, 2); bool value = (eventDelegate == null) ? (obj == null) : eventDelegate.Equals(obj); LuaDLL.lua_pushboolean(L, value); result = 1; } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }
/// <summary> /// Append a new event delegate to the list. /// </summary> static public EventDelegate Add (List<EventDelegate> list, Callback callback, bool oneShot) { if (list != null) { for (int i = 0, imax = list.Count; i < imax; ++i) { EventDelegate del = list[i]; if (del != null && del.Equals(callback)) return del; } EventDelegate ed = new EventDelegate(callback); ed.oneShot = oneShot; list.Add(ed); return ed; } Debug.LogWarning("Attempting to add a callback to a list that's null"); return null; }
public static Boolean Remove(List <EventDelegate> list, EventDelegate ev) { if (list != null) { Int32 i = 0; Int32 count = list.Count; while (i < count) { EventDelegate eventDelegate = list[i]; if (eventDelegate != null && eventDelegate.Equals(ev)) { list.RemoveAt(i); return(true); } i++; } } return(false); }
static public EventDelegate Add(List <EventDelegate> list, EventDelegate ed, float shotInterval = 0f) { if (list != null) { for (int i = 0; i < list.Count; i++) { EventDelegate del = list[i]; if (del != null && del.Equals(ed)) { return(del); } } list.Add(ed); return(ed); } Debug.LogWarning("Attempting to add a callback to a list that's null"); return(null); }
public static bool Remove(List <EventDelegate> list, EventDelegate ev) { if (list != null) { int num = 0; int count = list.Count; while (num < count) { EventDelegate item = list[num]; if (item != null && item.Equals(ev)) { list.RemoveAt(num); return(true); } num++; } } return(false); }
public static bool Remove(List <EventDelegate> list, EventDelegate.Callback callback) { if (list != null) { int i = 0; int count = list.Count; while (i < count) { EventDelegate eventDelegate = list[i]; if (eventDelegate != null && eventDelegate.Equals(callback)) { list.RemoveAt(i); return(true); } i++; } } return(false); }
public static bool Remove(List <EventDelegate> list, EventDelegate ev) { if (list != null) { int i = 0; int count = list.get_Count(); while (i < count) { EventDelegate eventDelegate = list.get_Item(i); if (eventDelegate != null && eventDelegate.Equals(ev)) { list.RemoveAt(i); return(true); } i++; } } return(false); }
public static bool Remove(List <EventDelegate> list, EventDelegate.Callback callback) { bool result; if (list != null) { for (int i = 0; i < list.Count; i++) { EventDelegate eventDelegate = list[i]; if (eventDelegate != null && eventDelegate.Equals(callback)) { list.RemoveAt(i); result = true; return(result); } } } result = false; return(result); }
/// <summary> /// Append a new event delegate to the list. /// </summary> static public void Add(List <EventDelegate> list, Callback callback, bool oneShot) { if (list != null) { for (int i = 0, imax = list.Count; i < imax; ++i) { EventDelegate del = list[i]; if (del != null && del.Equals(callback)) { return; } } EventDelegate ed = new EventDelegate(callback); ed.oneShot = oneShot; list.Add(ed); } else { } }
public static EventDelegate Add(List <EventDelegate> list, Callback callback, bool oneShot) { if (list != null) { int i = 0; for (int count = list.Count; i < count; i++) { EventDelegate eventDelegate = list[i]; if (eventDelegate != null && eventDelegate.Equals(callback)) { return(eventDelegate); } } EventDelegate eventDelegate2 = new EventDelegate(callback); eventDelegate2.oneShot = oneShot; list.Add(eventDelegate2); return(eventDelegate2); } Debug.LogWarning("Attempting to add a callback to a list that's null"); return(null); }
/// <summary> /// Append a new event delegate to the list. /// </summary> static public void Add(List <EventDelegate> list, Callback callback, bool oneShot) { if (list != null) { for (int i = 0, imax = list.Count; i < imax; ++i) { EventDelegate del = list[i]; if (del != null && del.Equals(callback)) { return; } } EventDelegate ed = new EventDelegate(callback); ed.oneShot = oneShot; list.Add(ed); } else { ClientLog.Instance.LogWarning("Attempting to add a callback to a list that's null"); } }
public static void Add(List <EventDelegate> list, EventDelegate ev, bool oneShot) { if (ev.mRawDelegate || ev.target == null || string.IsNullOrEmpty(ev.methodName)) { EventDelegate.Add(list, ev.mCachedCallback, oneShot); } else if (list == null) { Debug.LogWarning("Attempting to add a callback to a list that's null"); } else { int num = 0; int count = list.Count; while (num < count) { EventDelegate item = list[num]; if (item != null && item.Equals(ev)) { return; } num++; } EventDelegate eventDelegate = new EventDelegate(ev.target, ev.methodName) { oneShot = oneShot }; if (ev.mParameters != null && (int)ev.mParameters.Length > 0) { eventDelegate.mParameters = new EventDelegate.Parameter[(int)ev.mParameters.Length]; for (int i = 0; i < (int)ev.mParameters.Length; i++) { eventDelegate.mParameters[i] = ev.mParameters[i]; } } list.Add(eventDelegate); } }
public static EventDelegate Add(List <EventDelegate> list, EventDelegate.Callback callback, Boolean oneShot) { if (list != null) { Int32 i = 0; Int32 count = list.Count; while (i < count) { EventDelegate eventDelegate = list[i]; if (eventDelegate != null && eventDelegate.Equals(callback)) { return(eventDelegate); } i++; } EventDelegate eventDelegate2 = new EventDelegate(callback); eventDelegate2.oneShot = oneShot; list.Add(eventDelegate2); return(eventDelegate2); } global::Debug.LogWarning("Attempting to add a callback to a list that's null"); return((EventDelegate)null); }
public static EventDelegate Add(List <EventDelegate> list, EventDelegate.Callback callback, bool oneShot) { if (list != null) { int i = 0; int count = list.get_Count(); while (i < count) { EventDelegate eventDelegate = list.get_Item(i); if (eventDelegate != null && eventDelegate.Equals(callback)) { return(eventDelegate); } i++; } EventDelegate eventDelegate2 = new EventDelegate(callback); eventDelegate2.oneShot = oneShot; list.Add(eventDelegate2); return(eventDelegate2); } Debug.LogWarning("Attempting to add a callback to a list that's null"); return(null); }
static int _m_Equals(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); EventDelegate __cl_gen_to_be_invoked = (EventDelegate)translator.FastGetCSObj(L, 1); { object obj = translator.GetObject(L, 2, typeof(object)); bool __cl_gen_ret = __cl_gen_to_be_invoked.Equals(obj); LuaAPI.lua_pushboolean(L, __cl_gen_ret); return(1); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } }
public static void Add(List <EventDelegate> list, EventDelegate ev, Boolean oneShot) { if (ev.mRawDelegate || ev.target == (UnityEngine.Object)null || String.IsNullOrEmpty(ev.methodName)) { EventDelegate.Add(list, ev.mCachedCallback, oneShot); } else if (list != null) { Int32 i = 0; Int32 count = list.Count; while (i < count) { EventDelegate eventDelegate = list[i]; if (eventDelegate != null && eventDelegate.Equals(ev)) { return; } i++; } EventDelegate eventDelegate2 = new EventDelegate(ev.target, ev.methodName); eventDelegate2.oneShot = oneShot; if (ev.mParameters != null && (Int32)ev.mParameters.Length > 0) { eventDelegate2.mParameters = new EventDelegate.Parameter[(Int32)ev.mParameters.Length]; for (Int32 j = 0; j < (Int32)ev.mParameters.Length; j++) { eventDelegate2.mParameters[j] = ev.mParameters[j]; } } list.Add(eventDelegate2); } else { global::Debug.LogWarning("Attempting to add a callback to a list that's null"); } }
private static int Equals(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 2); EventDelegate eventDelegate = LuaScriptMgr.GetVarObject(L, 1) as EventDelegate; object varObject = LuaScriptMgr.GetVarObject(L, 2); bool b = (eventDelegate == null) ? (varObject == null) : eventDelegate.Equals(varObject); LuaScriptMgr.Push(L, b); return(1); }