Example #1
0
    private SystemChatItem GetSystemItem(SystemChatInfo info)
    {
        SystemChatItem item;
        GameObject     go;

        if (mSysPrefabsList.Count >= MAXCACHE)
        {
            item = mSysPrefabsList[0];
            mSysPrefabsList.Remove(item);
            if (item.GetComponent <SystemChatItem>() != null)
            {
                PoolManager.PushPrefab(PoolManager.PoolKey.Prefab_SystemChatItem, item.gameObject);
            }
        }
        go = GameObject.Instantiate(PoolManager.PopPrefab(PoolManager.PoolKey.Prefab_SystemChatItem));
        go.transform.localPosition = Vector3.zero;
        item = go.GetComponent <SystemChatItem>();
        go.transform.parent        = panel.SystemGrid.transform;
        go.transform.localScale    = Vector3.one;
        go.transform.localPosition = Vector3.zero;
        go.transform.localRotation = Quaternion.identity;
        go.gameObject.SetActive(true);
        mSysPrefabsList.Add(item);
        return(item);
    }
Example #2
0
    public void SendSystemChatInfoToPanel(ChatType type, SystemChatInfo info)
    {
        SystemChatInfo data = new SystemChatInfo();

        SystemShow(data);
        panel.SystemGrid.Reposition();
    }
Example #3
0
    private void SystemShow(SystemChatInfo info)
    {
        SystemChatItem item = GetSystemItem(info);

        item.data = info;
    }