예제 #1
0
    private void LoadFaces()
    {
        List <ChatManager.FaceSuit> faceSuits = ChatManager.Instance.GetFaceSuits();

        for (int i = 0; i < faceSuits.get_Count(); i++)
        {
            GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("Item2FaceSuit");
            UGUITools.SetParent(this.m_tranFaceSuits.get_gameObject(), instantiate2Prefab, false, "Item2Face" + i);
            Item2FaceSuit item2FaceSuit = instantiate2Prefab.AddUniqueComponent <Item2FaceSuit>();
            item2FaceSuit.SetFaceScale(1.5f);
            RectTransform rectTransform = item2FaceSuit.get_transform() as RectTransform;
            rectTransform.set_anchorMin(new Vector2(0.5f, 0.5f));
            rectTransform.set_anchorMax(new Vector2(0.5f, 0.5f));
            rectTransform.set_pivot(new Vector2(0.5f, 0.5f));
            rectTransform.set_sizeDelta(new Vector2(0f, 0f));
            UGUITools.ResetTransform(rectTransform);
            int num = faceSuits.get_Item(i).num;
            item2FaceSuit.SetFaces(faceSuits.get_Item(i).icons, delegate
            {
                if (ChatUIViewModel.Instance != null && ChatUIView.Instance != null)
                {
                    if (ChatUIView.Instance.m_ChatInputUnit.FaceNum >= ChatManager.MAX_NUM_2_FACE)
                    {
                        FloatTextAddManager.Instance.AddFloatText(GameDataUtils.GetChineseContent(502063, false), Color.get_green());
                    }
                    else
                    {
                        ChatUIViewModel expr_5D = ChatUIViewModel.Instance;
                        expr_5D.SendContent    += ChatManager.FacePlaceholder + num.ToString("D2");
                    }
                }
            });
        }
    }
예제 #2
0
 public void SetCurrentPrivateTalk(long id, string name, bool bReset = false)
 {
     if (!bReset)
     {
         this.CurrentPrivateTalk.Set(id, name);
         ChatUIViewModel.Add2PrivateTalks(this.CurrentPrivateTalk);
         this.ChatSendPlaceholder = "对" + TextColorMgr.GetColor(name, "F87D04", string.Empty) + "说:";
     }
     else
     {
         this.CurrentPrivateTalk.ResetAll();
         if (this.CurrentChatChannel == 4)
         {
             this.ChatSendPlaceholder = "请选择私聊对象";
         }
     }
     if (ChatUIViewModel.Instance != null)
     {
         ChatUIViewModel.Instance.BtnPrivateTalkName = this.CurrentPrivateTalk.PrivateTalkName;
     }
 }
예제 #3
0
 protected override void Awake()
 {
     base.Awake();
     ChatUIViewModel.m_instance = this;
 }