//更改在线状态
        public void ChangeOnLine(UInt64 temp)
        {
            GameObject obj = FriendManager.Instance.GetObj(temp);

            if (obj == null)
            {
                return;
            }
            bool isVib = false;

            if (FriendManager.Instance.AllFriends.ContainsKey(temp))
            {
                isVib = FriendManager.Instance.AllFriends[temp].isOnline;
            }
            else if (FriendManager.Instance.AllBlackDic.ContainsKey(temp))
            {
                isVib = FriendManager.Instance.AllBlackDic[temp].isOnline;
            }
            if (FriendListUI.ContainsKey(obj))
            {
                FriendListUI[obj].mOnLine.gameObject.SetActive(isVib);
                FriendListUI[obj].mOffLine.gameObject.SetActive(!isVib);
                FriendListUI[obj].mNickName.text = FriendManager.Instance.AllFriends[temp].NiceName;
                uint vip = FriendManager.Instance.AllFriends[temp].isVip;
                FriendListUI[obj].mVipSign.text = "VIP" + vip.ToString();
                FriendListUI[obj].mVipSign.gameObject.SetActive(vip != 0);
            }
            mFriendGrid.repositionNow = true;
            mFriendGrid.Reposition();
        }
 void Clear(Transform temp)
 {
     LastObj = null;
     SGUID   = 0;
     foreach (var item in FriendListUI)
     {
         UnityEngine.GameObject.DestroyImmediate(item.Key);
     }
     FriendListUI.Clear();
     FriendManager.Instance.OnClickKey.Clear();
 }
        void ShowOnLine(bool isOn, Dictionary <UInt64, Friend> temp, bool isVib = true)
        {
            SetBtnVib(false);
            foreach (var item in temp.Values)
            {
                SetBtnVib(true);
                GameObject obj = null;
                if (item.isOnline == isOn)
                {
                    ResourceUnit objUnit = ResourcesManager.Instance.loadImmediate(GameConstDefine.LoadFriendUI, ResourceType.PREFAB);
                    obj = GameObject.Instantiate(objUnit.Asset) as GameObject;
                    obj.transform.parent        = mFriendGrid.transform;
                    obj.transform.localPosition = Vector3.zero;
                    obj.transform.localScale    = Vector3.one;

                    UIFriend friend = new UIFriend();
                    friend.mHeadID         = obj.transform.Find("HeadPhoto").GetComponent <UISprite>();
                    friend.mNickName       = obj.transform.Find("Name").GetComponent <UILabel>();
                    friend.mVipSign        = obj.transform.Find("VipSign").GetComponent <UILabel>();
                    friend.mLadderIntegral = obj.transform.Find("Ladder/Score").GetComponent <UILabel>();
                    friend.mHighLight      = obj.transform.Find("HighLight").GetComponent <UISprite>();
                    friend.mOnLine         = obj.transform.Find("Online").gameObject;
                    friend.mOffLine        = obj.transform.Find("Offline").gameObject;
                    friend.objParent       = obj;
                    FriendListUI.Add(obj, friend);
                    FriendManager.Instance.AddOnClickKey(obj, item);
                    if (isVib)
                    {
                        friend.mOnLine.gameObject.SetActive(item.isOnline);
                        friend.mOffLine.gameObject.SetActive(!item.isOnline);
                    }
                    else
                    {
                        friend.mOnLine.gameObject.SetActive(false);
                        friend.mOffLine.gameObject.SetActive(false);
                    }
                    friend.mNickName.text     = friend.NickName = item.NiceName;
                    friend.mHeadID.spriteName = item.HeadId.ToString();
                    friend.mVipSign.gameObject.SetActive(item.isVip != 0);
                    friend.mVipSign.text              = "VIP" + item.isVip.ToString();
                    UIEventListener.Get(obj).onClick += onClickSelect;
                }
            }
        }
 private void onClickSelect(GameObject go)
 {
     if (LastObj != null && LastObj.objParent == go)//the same
     {
         return;
     }
     if (LastObj == null && FriendListUI.TryGetValue(go, out LastObj))// first time
     {
         LastObj.mHighLight.gameObject.SetActive(true);
         return;
     }
     if (LastObj != null)
     {
         LastObj.mHighLight.gameObject.SetActive(false);
     }
     if (FriendListUI.TryGetValue(go, out LastObj))
     {
         LastObj.mHighLight.gameObject.SetActive(true);
     }
 }
        private void RemoveGrid(UInt64 sGUID)
        {
            UIFriend   temp = null;
            GameObject obj  = null;

            if (FriendManager.Instance.AllTalkDic.ContainsKey(sGUID))
            {
                FriendManager.Instance.DelAllTalkDic(sGUID);
                ChatTaskCtrl.Instance.SetDestoy(sGUID);
            }
            if (LastObj == null)
            {
                obj = FriendManager.Instance.GetObj(sGUID);
                if (obj == null)
                {
                    return;
                }
                FriendListUI.TryGetValue(obj, out temp);
            }
            else if (FriendListUI.TryGetValue(LastObj.objParent, out temp))
            {
                obj = LastObj.objParent;
            }
            ChatTaskCtrl.Instance.SetNewChat();
            FriendManager.Instance.RemoveOnClickKey(obj);
            FriendListUI[obj] = null;
            FriendListUI.Remove(obj);
            UnityEngine.GameObject.DestroyImmediate(temp.objParent);
            LastObj = null; SGUID = 0;
            if (mFriendToggle.value)
            {
                FriendList();
            }
            else if (mBlackToggle.value)
            {
                BlackList();
            }
            mFriendGrid.repositionNow = true;
            mFriendGrid.Reposition();
        }