private void CleanOverflow() { int clean = mActive.Count + 1 - MaxHistoryCount; for (int i = 0; i < clean; ++i) { MainMenuChatItem item = mActive.Dequeue(); Recycle(item); } }
/*private void Reposition() * { * scrollView.InvalidateBounds(); * if (scrollView.canMoveVertically) * { #if REVERSE_ORDER * float target = 0.0f; #else * float target = 1.0f; #endif * if (mInvalid) * { * scrollView.SetDragAmount(1f, target, false); * scrollView.SetDragAmount(1f, target, true); * } * else if (Mathf.Abs(target - scrollView.verticalScrollBar.value) < 0.01f) * { * scrollView.SetDragAmount(1f, target, false); * } * scrollView.UpdatePosition(); * } * mInvalid = false; * }*/ private ChatItem Use() { if (mPool.Count > 0) { ChatItem item = mPool.Dequeue(); item.mDMono.gameObject.CustomSetActive(true); mActive.Enqueue(item); item.mDMono.transform.parent = mainTable.transform; item.mDMono.transform.localPosition = Vector3.zero; item.mDMono.transform.localScale = Vector3.one; item.mDMono.transform.localEulerAngles = Vector3.zero; item.mDMono.transform.SetAsLastSibling(); return(item); } else { DynamicMonoILR ilr = UnityEngine.Object.Instantiate(mActive[mActive.Count - 1].mDMono); ChatItem item = ilr._ilrObject as ChatItem; mActive.Enqueue(item); item.mDMono.transform.parent = mainTable.transform; item.mDMono.transform.localPosition = Vector3.zero; item.mDMono.transform.localScale = Vector3.one; item.mDMono.transform.localEulerAngles = Vector3.zero; item.mDMono.transform.SetAsLastSibling(); item.SetItemData(null); return(item); } }
static StackObject *Dequeue_1(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); EB.CircularBuffer <global::DynamicMonoILR> instance_of_this_method = (EB.CircularBuffer <global::DynamicMonoILR>) typeof(EB.CircularBuffer <global::DynamicMonoILR>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.Dequeue(); object obj_result_of_this_method = result_of_this_method; if (obj_result_of_this_method is CrossBindingAdaptorType) { return(ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance)); } return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method)); }