public static Item2Face CreateFace(int num, Transform parent) { ChatManager.FaceSuit faceSuitByNum = ChatManager.Instance.GetFaceSuitByNum(num); Item2Face item2Face = ChatManager.CreatePrefab2Face("Item2Face" + num); UGUITools.ResetTransform(item2Face.get_transform(), parent); RectTransform rectTransform = item2Face.get_transform() as RectTransform; rectTransform.set_anchorMin(ConstVector2.LR); rectTransform.set_anchorMax(ConstVector2.LR); rectTransform.set_pivot(ConstVector2.LR); rectTransform.set_sizeDelta(Vector2.get_zero()); item2Face.SetFaces(faceSuitByNum.icons); return(item2Face); }
private bool HorizonalOverflowIsFalse(float length, string previous_content, DetailInfo detailInfo) { int num = (int)(length / this.LINE_WIDTH); float num2 = length % this.LINE_WIDTH; if (this.IsLimitOneLine() && num > 0) { return(false); } if (detailInfo.type == DetailType.DT.Face) { Item2Face item2Face = ChatManager.CreateFace(detailInfo.cfgId, this.FaceParent); item2Face.SetFaceSize(this.FONT_SIZE); this.Faces.Add(item2Face); RectTransform rectTransform = item2Face.get_transform() as RectTransform; rectTransform.set_anchoredPosition(new Vector2(num2, (float)(-(float)num * this.FONT_SIZE))); RectTransform expr_80 = rectTransform; expr_80.set_anchoredPosition(expr_80.get_anchoredPosition() + this.GetFaceOffset()); return(true); } string detailInfoName = ChatManager.GetDetailInfoName(detailInfo); this.ButtonItem(previous_content, detailInfo, detailInfoName); return(true); }
private void CreateFace(string content, int index, int num) { float preferredWidth = ChatManager.Instance.GetPreferredWidth(content.Substring(0, index), this.FONT_SIZE, true); Item2Face item2Face = ChatManager.CreateFace(num, base.FaceParent); item2Face.SetFaceSize(this.FONT_SIZE); this.Faces.Add(item2Face); RectTransform rectTransform = item2Face.get_transform() as RectTransform; rectTransform.set_anchoredPosition(new Vector2(preferredWidth, 0f)); RectTransform expr_5D = rectTransform; expr_5D.set_anchoredPosition(expr_5D.get_anchoredPosition() + ChatInfo2Input.FACE_OFFSET); }
private bool HorizonalOverflowIsTrue(float length, string previous_content, DetailInfo detailInfo) { if (detailInfo.type == DetailType.DT.Face) { Item2Face item2Face = ChatManager.CreateFace(detailInfo.cfgId, this.FaceParent); item2Face.SetFaceSize(this.FONT_SIZE); this.Faces.Add(item2Face); RectTransform rectTransform = item2Face.get_transform() as RectTransform; rectTransform.set_anchoredPosition(new Vector2(length, 0f)); RectTransform expr_54 = rectTransform; expr_54.set_anchoredPosition(expr_54.get_anchoredPosition() + this.GetFaceOffset()); return(true); } string detailInfoName = ChatManager.GetDetailInfoName(detailInfo); this.ButtonItem(previous_content, detailInfo, detailInfoName); return(true); }