// Token: 0x06004579 RID: 17785 RVA: 0x001047A0 File Offset: 0x001029A0 private void rebuildUV(global::dfRenderData renderData) { global::dfList <Vector2> uv = renderData.UV; uv.Add(new Vector2(0f, 1f)); uv.Add(new Vector2(1f, 1f)); uv.Add(new Vector2(1f, 0f)); uv.Add(new Vector2(0f, 0f)); Vector2 value = Vector2.zero; if (this.flip.IsSet(global::dfSpriteFlip.FlipHorizontal)) { value = uv[1]; uv[1] = uv[0]; uv[0] = value; value = uv[3]; uv[3] = uv[2]; uv[2] = value; } if (this.flip.IsSet(global::dfSpriteFlip.FlipVertical)) { value = uv[0]; uv[0] = uv[3]; uv[3] = value; value = uv[1]; uv[1] = uv[2]; uv[2] = value; } }
// Token: 0x06004486 RID: 17542 RVA: 0x000FFEE4 File Offset: 0x000FE0E4 private static void rebuildUV(global::dfRenderData renderData, global::dfSprite.RenderOptions options) { Rect region = options.spriteInfo.region; global::dfList <Vector2> uv = renderData.UV; uv.Add(new Vector2(region.x, region.yMax)); uv.Add(new Vector2(region.xMax, region.yMax)); uv.Add(new Vector2(region.xMax, region.y)); uv.Add(new Vector2(region.x, region.y)); Vector2 value = Vector2.zero; if (options.flip.IsSet(global::dfSpriteFlip.FlipHorizontal)) { value = uv[1]; uv[1] = uv[0]; uv[0] = value; value = uv[3]; uv[3] = uv[2]; uv[2] = value; } if (options.flip.IsSet(global::dfSpriteFlip.FlipVertical)) { value = uv[0]; uv[0] = uv[3]; uv[3] = value; value = uv[1]; uv[1] = uv[2]; uv[2] = value; } }
// Token: 0x060042AA RID: 17066 RVA: 0x000F59B4 File Offset: 0x000F3BB4 public static global::dfList <T> .FunctorComparer Obtain(Comparison <T> comparison) { global::dfList <T> .FunctorComparer functorComparer = (global::dfList <T> .FunctorComparer.pool.Count <= 0) ? new global::dfList <T> .FunctorComparer() : global::dfList <T> .FunctorComparer.pool.Dequeue(); functorComparer.comparison = comparison; return(functorComparer); }
// Token: 0x0600467E RID: 18046 RVA: 0x001086EC File Offset: 0x001068EC public override void Render(string text, global::dfRenderData destination) { global::dfDynamicFont.DynamicFontRenderer.textColors.Clear(); global::dfDynamicFont.DynamicFontRenderer.textColors.Push(Color.white); this.tokenize(text); global::dfList <global::dfDynamicFont.LineRenderInfo> dfList = this.calculateLinebreaks(); int num = 0; int num2 = 0; Vector3 position = (base.VectorOffset / base.PixelRatio).CeilToInt(); for (int i = 0; i < dfList.Count; i++) { global::dfDynamicFont.LineRenderInfo lineRenderInfo = dfList[i]; int count = destination.Vertices.Count; int startIndex = (this.SpriteBuffer == null) ? 0 : this.SpriteBuffer.Vertices.Count; this.renderLine(dfList[i], global::dfDynamicFont.DynamicFontRenderer.textColors, position, destination); position.y -= lineRenderInfo.lineHeight; num = Mathf.Max((int)lineRenderInfo.lineWidth, num); num2 += Mathf.CeilToInt(lineRenderInfo.lineHeight); if (lineRenderInfo.lineWidth > base.MaxSize.x) { this.clipRight(destination, count); this.clipRight(this.SpriteBuffer, startIndex); } this.clipBottom(destination, count); this.clipBottom(this.SpriteBuffer, startIndex); } base.RenderedSize = new Vector2(Mathf.Min(base.MaxSize.x, (float)num), Mathf.Min(base.MaxSize.y, (float)num2)) * base.TextScale; }
// Token: 0x0600428C RID: 17036 RVA: 0x000F5488 File Offset: 0x000F3688 public global::dfList <T> GetRange(int index, int length) { global::dfList <T> dfList = global::dfList <T> .Obtain(length); this.CopyTo(0, dfList.items, index, length); return(dfList); }
// Token: 0x06004585 RID: 17797 RVA: 0x0010547C File Offset: 0x0010367C private void addQuadTriangles(global::dfList <int> triangles, int baseIndex) { for (int i = 0; i < global::dfTiledSprite.quadTriangles.Length; i++) { triangles.Add(global::dfTiledSprite.quadTriangles[i] + baseIndex); } }
// Token: 0x06004268 RID: 17000 RVA: 0x000F4C80 File Offset: 0x000F2E80 internal static global::dfList <T> Obtain(int capacity) { global::dfList <T> dfList = global::dfList <T> .Obtain(); dfList.EnsureCapacity(capacity); return(dfList); }
// Token: 0x060040D6 RID: 16598 RVA: 0x000ED390 File Offset: 0x000EB590 public override void Render(string text, global::dfRenderData destination) { global::dfFont.BitmappedFontRenderer.textColors.Clear(); global::dfFont.BitmappedFontRenderer.textColors.Push(Color.white); this.tokenize(text); global::dfList <global::dfFont.LineRenderInfo> dfList = this.calculateLinebreaks(); int num = 0; int num2 = 0; Vector3 vectorOffset = base.VectorOffset; float num3 = base.TextScale * base.PixelRatio; for (int i = 0; i < dfList.Count; i++) { global::dfFont.LineRenderInfo lineRenderInfo = dfList[i]; int count = destination.Vertices.Count; this.renderLine(dfList[i], global::dfFont.BitmappedFontRenderer.textColors, vectorOffset, destination); vectorOffset.y -= (float)base.Font.LineHeight * num3; num = Mathf.Max((int)lineRenderInfo.lineWidth, num); num2 += (int)lineRenderInfo.lineHeight; if (lineRenderInfo.lineWidth * base.TextScale > base.MaxSize.x) { this.clipRight(destination, count); } if ((float)num2 * base.TextScale > base.MaxSize.y) { this.clipBottom(destination, count); } } base.RenderedSize = new Vector2(Mathf.Min(base.MaxSize.x, (float)num), Mathf.Min(base.MaxSize.y, (float)num2)) * base.TextScale; }
// Token: 0x060042A0 RID: 17056 RVA: 0x000F583C File Offset: 0x000F3A3C public static global::dfList <T> .PooledEnumerator Obtain(global::dfList <T> list, System.Func <T, bool> predicate = null) { global::dfList <T> .PooledEnumerator pooledEnumerator = (global::dfList <T> .PooledEnumerator.pool.Count <= 0) ? new global::dfList <T> .PooledEnumerator() : global::dfList <T> .PooledEnumerator.pool.Dequeue(); pooledEnumerator.ResetInternal(list, predicate); return(pooledEnumerator); }
// Token: 0x060042A3 RID: 17059 RVA: 0x000F58B8 File Offset: 0x000F3AB8 private void ResetInternal(global::dfList <T> list, System.Func <T, bool> predicate = null) { this.isValid = true; this.list = list; this.predicate = predicate; this.currentIndex = 0; this.currentValue = default(T); }
// Token: 0x06004271 RID: 17009 RVA: 0x000F4D60 File Offset: 0x000F2F60 public global::dfList <T> Clone() { global::dfList <T> dfList = global::dfList <T> .Obtain(this.count); Array.Copy(this.items, dfList.items, this.count); dfList.count = this.count; return(dfList); }
// Token: 0x06004297 RID: 17047 RVA: 0x000F573C File Offset: 0x000F393C public global::dfList <T> Concat(global::dfList <T> list) { global::dfList <T> dfList = global::dfList <T> .Obtain(this.count + list.count); dfList.AddRange(this); dfList.AddRange(list); return(dfList); }
// Token: 0x06004485 RID: 17541 RVA: 0x000FFE9C File Offset: 0x000FE09C private static void rebuildColors(global::dfRenderData renderData, global::dfSprite.RenderOptions options) { global::dfList <Color32> colors = renderData.Colors; colors.Add(options.color); colors.Add(options.color); colors.Add(options.color); colors.Add(options.color); }
// Token: 0x060041D7 RID: 16855 RVA: 0x000F1E98 File Offset: 0x000F0098 internal void Process(Transform transform, Camera renderCamera, global::dfList <Touch> touches, bool retainFocus) { for (int i = 0; i < touches.Count; i++) { Touch touch = touches[i]; Ray ray = renderCamera.ScreenPointToRay(touch.position); float num = renderCamera.farClipPlane - renderCamera.nearClipPlane; RaycastHit[] hits = Physics.RaycastAll(ray, num, renderCamera.cullingMask); global::dfInputManager.controlUnderMouse = this.clipCast(transform, hits); if (global::dfInputManager.controlUnderMouse == null && touch.phase == null) { this.untracked.Add(touch.fingerId); } else if (this.untracked.Contains(touch.fingerId)) { if (touch.phase == 3) { this.untracked.Remove(touch.fingerId); } } else { global::dfInputManager.TouchInputManager.TouchRaycast info = new global::dfInputManager.TouchInputManager.TouchRaycast(global::dfInputManager.controlUnderMouse, touch, ray); global::dfInputManager.TouchInputManager.ControlTouchTracker controlTouchTracker = this.tracked.FirstOrDefault((global::dfInputManager.TouchInputManager.ControlTouchTracker x) => x.IsTrackingFinger(info.FingerID)); if (controlTouchTracker != null) { controlTouchTracker.Process(info); } else { bool flag = false; for (int j = 0; j < this.tracked.Count; j++) { if (this.tracked[j].Process(info)) { flag = true; break; } } if (!flag && global::dfInputManager.controlUnderMouse != null) { if (!this.tracked.Any((global::dfInputManager.TouchInputManager.ControlTouchTracker x) => x.control == global::dfInputManager.controlUnderMouse)) { if (global::dfInputManager.controlUnderMouse == null) { Debug.Log("Tracking touch with no control: " + touch.fingerId); } global::dfInputManager.TouchInputManager.ControlTouchTracker controlTouchTracker2 = new global::dfInputManager.TouchInputManager.ControlTouchTracker(this.manager, global::dfInputManager.controlUnderMouse); this.tracked.Add(controlTouchTracker2); controlTouchTracker2.Process(info); } } } } } }
// Token: 0x06004298 RID: 17048 RVA: 0x000F576C File Offset: 0x000F396C public global::dfList <TResult> Convert <TResult>() { global::dfList <TResult> dfList = global::dfList <TResult> .Obtain(this.count); for (int i = 0; i < this.count; i++) { dfList.Add((TResult)((object)System.Convert.ChangeType(this.items[i], typeof(TResult)))); } return(dfList); }
// Token: 0x0600468E RID: 18062 RVA: 0x00109AB4 File Offset: 0x00107CB4 private static void addTriangleIndices(global::dfList <Vector3> verts, global::dfList <int> triangles) { int count = verts.Count; int[] triangle_INDICES = global::dfDynamicFont.DynamicFontRenderer.TRIANGLE_INDICES; for (int i = 0; i < triangle_INDICES.Length; i++) { triangles.Add(count + triangle_INDICES[i]); } }
// Token: 0x060046C4 RID: 18116 RVA: 0x0010B268 File Offset: 0x00109468 private static void addTriangleIndices(global::dfList <Vector3> verts, global::dfList <int> triangles) { int count = verts.Count; int[] triangle_INDICES = global::dfMarkupBoxTexture.TRIANGLE_INDICES; for (int i = 0; i < triangle_INDICES.Length; i++) { triangles.Add(count + triangle_INDICES[i]); } }
// Token: 0x06004439 RID: 17465 RVA: 0x000FDD98 File Offset: 0x000FBF98 private static void rebuildTriangles(global::dfRenderData renderData, global::dfSprite.RenderOptions options) { int baseIndex = options.baseIndex; global::dfList <int> triangles = renderData.Triangles; for (int i = 0; i < global::dfSlicedSprite.triangleIndices.Length; i++) { triangles.Add(baseIndex + global::dfSlicedSprite.triangleIndices[i]); } }
// Token: 0x06004586 RID: 17798 RVA: 0x001054B0 File Offset: 0x001036B0 private void addQuadColors(global::dfList <Color32> colors) { colors.EnsureCapacity(colors.Count + 4); Color32 item = base.ApplyOpacity((!base.IsEnabled) ? this.disabledColor : this.color); for (int i = 0; i < 4; i++) { colors.Add(item); } }
// Token: 0x06004296 RID: 17046 RVA: 0x000F56F0 File Offset: 0x000F38F0 public global::dfList <TResult> Select <TResult>(System.Func <T, TResult> selector) { global::dfList <TResult> dfList = global::dfList <TResult> .Obtain(this.count); for (int i = 0; i < this.count; i++) { dfList.Add(selector(this.items[i])); } return(dfList); }
// Token: 0x06004483 RID: 17539 RVA: 0x000FFD20 File Offset: 0x000FDF20 private static void rebuildTriangles(global::dfRenderData renderData, global::dfSprite.RenderOptions options) { int baseIndex = options.baseIndex; global::dfList <int> triangles = renderData.Triangles; triangles.EnsureCapacity(triangles.Count + global::dfSprite.TRIANGLE_INDICES.Length); for (int i = 0; i < global::dfSprite.TRIANGLE_INDICES.Length; i++) { triangles.Add(baseIndex + global::dfSprite.TRIANGLE_INDICES[i]); } }
// Token: 0x060042EE RID: 17134 RVA: 0x000F6C80 File Offset: 0x000F4E80 private void clipQuads(global::dfRenderData buffer, int startIndex) { global::dfList <Vector3> vertices = buffer.Vertices; global::dfList <Vector2> uv = buffer.UV; float num = base.PixelsToUnits(); float num2 = (base.Pivot.TransformToUpperLeft(base.Size).y - (float)this.listPadding.top) * num; float num3 = num2 - (this.size.y - (float)this.listPadding.vertical) * num; for (int i = startIndex; i < vertices.Count; i += 4) { Vector3 value = vertices[i]; Vector3 value2 = vertices[i + 1]; Vector3 value3 = vertices[i + 2]; Vector3 value4 = vertices[i + 3]; float num4 = value.y - value4.y; if (value4.y < num3) { float num5 = 1f - Mathf.Abs(-num3 + value.y) / num4; global::dfList <Vector3> dfList = vertices; int index = i; value..ctor(value.x, Mathf.Max(value.y, num3), value2.z); dfList[index] = value; global::dfList <Vector3> dfList2 = vertices; int index2 = i + 1; value2..ctor(value2.x, Mathf.Max(value2.y, num3), value2.z); dfList2[index2] = value2; global::dfList <Vector3> dfList3 = vertices; int index3 = i + 2; value3..ctor(value3.x, Mathf.Max(value3.y, num3), value3.z); dfList3[index3] = value3; global::dfList <Vector3> dfList4 = vertices; int index4 = i + 3; value4..ctor(value4.x, Mathf.Max(value4.y, num3), value4.z); dfList4[index4] = value4; float num6 = Mathf.Lerp(uv[i + 3].y, uv[i].y, num5); uv[i + 3] = new Vector2(uv[i + 3].x, num6); uv[i + 2] = new Vector2(uv[i + 2].x, num6); num4 = Mathf.Abs(value4.y - value.y); } if (value.y > num2) { float num7 = Mathf.Abs(num2 - value.y) / num4; vertices[i] = new Vector3(value.x, Mathf.Min(num2, value.y), value.z); vertices[i + 1] = new Vector3(value2.x, Mathf.Min(num2, value2.y), value2.z); vertices[i + 2] = new Vector3(value3.x, Mathf.Min(num2, value3.y), value3.z); vertices[i + 3] = new Vector3(value4.x, Mathf.Min(num2, value4.y), value4.z); float num8 = Mathf.Lerp(uv[i].y, uv[i + 3].y, num7); uv[i] = new Vector2(uv[i].x, num8); uv[i + 1] = new Vector2(uv[i + 1].x, num8); } } }
// Token: 0x06004294 RID: 17044 RVA: 0x000F5650 File Offset: 0x000F3850 public global::dfList <T> Where(System.Func <T, bool> predicate) { global::dfList <T> dfList = global::dfList <T> .Obtain(this.count); for (int i = 0; i < this.count; i++) { if (predicate(this.items[i])) { dfList.Add(this.items[i]); } } return(dfList); }
// Token: 0x060040D5 RID: 16597 RVA: 0x000ED320 File Offset: 0x000EB520 public override Vector2 MeasureString(string text) { this.tokenize(text); global::dfList <global::dfFont.LineRenderInfo> dfList = this.calculateLinebreaks(); int num = 0; int num2 = 0; for (int i = 0; i < dfList.Count; i++) { num = Mathf.Max((int)dfList[i].lineWidth, num); num2 += (int)dfList[i].lineHeight; } return(new Vector2((float)num, (float)num2) * base.TextScale); }
// Token: 0x06004276 RID: 17014 RVA: 0x000F4DF8 File Offset: 0x000F2FF8 public void Sort(Comparison <T> comparison) { if (comparison == null) { throw new ArgumentNullException("comparison"); } if (this.count > 0) { using (global::dfList <T> .FunctorComparer functorComparer = global::dfList <T> .FunctorComparer.Obtain(comparison)) { Array.Sort <T>(this.items, 0, this.count, functorComparer); } } }
// Token: 0x060046F9 RID: 18169 RVA: 0x0010BED4 File Offset: 0x0010A0D4 public static global::dfList <global::dfMarkupElement> Parse(global::dfRichTextLabel owner, string source) { global::dfList <global::dfMarkupElement> result; try { global::dfMarkupParser.parserInstance.owner = owner; global::dfList <global::dfMarkupElement> dfList = global::dfMarkupParser.parserInstance.parseMarkup(source); result = dfList; } finally { } return(result); }
// Token: 0x060046FB RID: 18171 RVA: 0x0010BFE0 File Offset: 0x0010A1E0 private global::dfList <global::dfMarkupElement> processTokens(Queue <global::dfMarkupElement> tokens) { global::dfList <global::dfMarkupElement> dfList = global::dfList <global::dfMarkupElement> .Obtain(); while (tokens.Count > 0) { dfList.Add(this.parseElement(tokens)); } for (int i = 0; i < dfList.Count; i++) { if (dfList[i] is global::dfMarkupTag) { ((global::dfMarkupTag)dfList[i]).Owner = this.owner; } } return(dfList); }
// Token: 0x0600467D RID: 18045 RVA: 0x00108680 File Offset: 0x00106880 public override Vector2 MeasureString(string text) { this.tokenize(text); global::dfList <global::dfDynamicFont.LineRenderInfo> dfList = this.calculateLinebreaks(); float num = 0f; float num2 = 0f; for (int i = 0; i < dfList.Count; i++) { num = Mathf.Max(dfList[i].lineWidth, num); num2 += dfList[i].lineHeight; } Vector2 result; result..ctor(num, num2); return(result); }
// Token: 0x06004583 RID: 17795 RVA: 0x00104BC8 File Offset: 0x00102DC8 protected override void OnRebuildRenderData() { if (base.Atlas == null) { return; } global::dfAtlas.ItemInfo spriteInfo = base.SpriteInfo; if (spriteInfo == null) { return; } this.renderData.Material = base.Atlas.Material; global::dfList <Vector3> vertices = this.renderData.Vertices; global::dfList <Vector2> uv = this.renderData.UV; global::dfList <Color32> colors = this.renderData.Colors; global::dfList <int> triangles = this.renderData.Triangles; Vector2[] spriteUV = this.buildQuadUV(); Vector2 vector = Vector2.Scale(spriteInfo.sizeInPixels, this.tileScale); Vector2 vector2; vector2..ctor(this.tileScroll.x % 1f, this.tileScroll.y % 1f); for (float num = -Mathf.Abs(vector2.y * vector.y); num < this.size.y; num += vector.y) { for (float num2 = -Mathf.Abs(vector2.x * vector.x); num2 < this.size.x; num2 += vector.x) { int count = vertices.Count; vertices.Add(new Vector3(num2, -num)); vertices.Add(new Vector3(num2 + vector.x, -num)); vertices.Add(new Vector3(num2 + vector.x, -num + -vector.y)); vertices.Add(new Vector3(num2, -num + -vector.y)); this.addQuadTriangles(triangles, count); this.addQuadUV(uv, spriteUV); this.addQuadColors(colors); } } this.clipQuads(vertices, uv); float num3 = base.PixelsToUnits(); Vector3 vector3 = this.pivot.TransformToUpperLeft(this.size); for (int i = 0; i < vertices.Count; i++) { vertices[i] = (vertices[i] + vector3) * num3; } }
// Token: 0x0600468C RID: 18060 RVA: 0x00109884 File Offset: 0x00107A84 private void clipBottom(global::dfRenderData destination, int startIndex) { if (destination == null) { return; } float num = base.VectorOffset.y - base.MaxSize.y * base.PixelRatio; global::dfList <Vector3> vertices = destination.Vertices; global::dfList <Vector2> uv = destination.UV; global::dfList <Color32> colors = destination.Colors; for (int i = startIndex; i < vertices.Count; i += 4) { Vector3 value = vertices[i]; Vector3 value2 = vertices[i + 1]; Vector3 value3 = vertices[i + 2]; Vector3 value4 = vertices[i + 3]; float num2 = value.y - value4.y; if (value4.y <= num) { float num3 = 1f - Mathf.Abs(-num + value.y) / num2; global::dfList <Vector3> dfList = vertices; int index = i; value..ctor(value.x, Mathf.Max(value.y, num), value2.z); dfList[index] = value; global::dfList <Vector3> dfList2 = vertices; int index2 = i + 1; value2..ctor(value2.x, Mathf.Max(value2.y, num), value2.z); dfList2[index2] = value2; global::dfList <Vector3> dfList3 = vertices; int index3 = i + 2; value3..ctor(value3.x, Mathf.Max(value3.y, num), value3.z); dfList3[index3] = value3; global::dfList <Vector3> dfList4 = vertices; int index4 = i + 3; value4..ctor(value4.x, Mathf.Max(value4.y, num), value4.z); dfList4[index4] = value4; uv[i + 3] = Vector2.Lerp(uv[i + 3], uv[i], num3); uv[i + 2] = Vector2.Lerp(uv[i + 2], uv[i + 1], num3); Color color = Color.Lerp(colors[i + 3], colors[i], num3); colors[i + 3] = color; colors[i + 2] = color; } } }