Example #1
0
    /// <summary>
    /// 팀편성창에서 쓰임.
    /// </summary>
    /// <param name="ItemInfo"></param>
    /// <param name="type"></param>
    public void SetIcon(CreatureItemInfo ItemInfo, enCreatureIcon_Type type)
    {
        if (m_ReinforceLevelLabel != null)
        {
            m_ReinforceLevelLabel.text = string.Format("{0}{1}", "+", ItemInfo.ForceCount);
        }
        if (m_LevelLabel != null)
        {
            m_LevelLabel.text = string.Format("{0}{1}", StringTableManager.GetData(12), ItemInfo.Level);
        }

        _CreatureTableData = UtilFunc.GetCreatureDataByTID(ItemInfo.Tid);

        //SetDefaultIcon(ItemInfo.m_Name, ItemInfo.m_icon, UtilFunc.IconSpriteName(ItemInfo.m_enCreatureArmy), ItemInfo.m_Grade);
        SetDefaultIcon(_CreatureTableData.iCreatureName, ItemInfo.IconName, ItemInfo.CreatureArmyType.ToString(), ItemInfo.Grade, ItemInfo.awake, ItemInfo.Quality);

        _CreatureKey     = ItemInfo.CreatureKey;
        m_iCreatureTID   = ItemInfo.Tid;
        m_iGrade         = ItemInfo.Grade;
        m_SellCheck      = ItemInfo.IsSell;
        m_Reinforce      = ItemInfo.ForceCount;
        m_szName         = ItemInfo.Name;
        m_szIcon         = ItemInfo.IconName;
        m_iLevel         = ItemInfo.Level;
        m_enCreatureArmy = ItemInfo.CreatureArmyType;
        m_iSellCost      = ItemInfo.SellCost;
        m_IsNew          = ItemInfo.IsNew;
        m_kLock          = ItemInfo.Lock;
    }
    private void SetCreatureItem(InfiniteItemBehavior itemBehaver, int dataIndex)
    {
        List <CreatureIcon> ItemElementList = itemBehaver.ItemElementList;
        int iCount = ItemElementList.Count;

        for (int i = 0; i < iCount; ++i)
        {
            int aIdx = ((dataIndex * iCount) + i);

            CreatureIcon ItemElement = ItemElementList[i];
            if (ItemElement == null)
            {
                continue;
            }

            if (_CreatureItemInfoList.Count > aIdx)
            {
                CreatureItemInfo ItemInfo = _CreatureItemInfoList[aIdx];
                if (ItemInfo == null)
                {
                    continue;
                }

                ItemElement.gameObject.SetActive(true);
                ItemElement.SetIcon(ItemInfo, enCreatureIcon_Type.Dispatch);

                ItemElement.SetActiveDispatchSelect(ItemInfo.IsDispatchSelect);
                ItemElement.SetDispatchSelectNumberLabel(ItemInfo.DispatchSelectNumber);
            }
            else
            {
                ItemElement.gameObject.SetActive(false);
            }
        }
    }
    public void SetDispatchSelect(CreatureIcon icon)
    {
        CreatureItemInfo info = _CreatureItemInfoList.Find((data) => data.CreatureKey == icon.CreatureKey);

        if (info == null)
        {
            return;
        }

        info.SetDispatchSelect(icon.IsDispatchSelect, icon.GetDispatchSelectNumberLabel());

        RefreshItemVisable();
    }
Example #4
0
    private void MakeUseCreatureData()
    {
        InventoryInfo pInven = UserInfo.Instance.InventoryInfo;

        if (pInven == null)
        {
            return;
        }

        Dictionary <ulong, ItemCreature> pDicValue = pInven.MapInvenCreature;

        if (pDicValue == null)
        {
            return;
        }

        _CreatureList.Clear();

        // 등급순 -> 레벨순으로 정렬.
        foreach (KeyValuePair <ulong, ItemCreature> dicvalue in pDicValue.OrderByDescending((data) => data.Value.Grade).ThenByDescending((data) => data.Value.Level))
        {
            ulong kCreatureKey = dicvalue.Key;

            if (UtilFunc.IsDispatching(kCreatureKey) == true)                                    // 파견중인 크리쳐는 제낌.
            {
                continue;
            }

            ItemCreature         pMy           = UserInfo.Instance.InventoryInfo.GetMyCreature(kCreatureKey);
            DATA_CREATURE_NEWVER pCreatureData = UtilFunc.GetCreatureDataByTID(pMy.Index);

            if (pCreatureData.m_iGrade < (int)m_DispatchTableData.RequireGrade)      // 필요등급 검사
            {
                continue;
            }

            if (pMy.Level < m_DispatchTableData.RequireLevel)                  // 필요레벨 검사
            {
                continue;
            }

            if (UserInfo.Instance.CreatureTeam.HasTempCreatureAll(kCreatureKey))        // 팀에 속해있는지 검사
            {
                continue;
            }

            CreatureItemInfo info = new CreatureItemInfo();
            info.Init(kCreatureKey, pMy, pCreatureData);
            info.SetDispatchSelect(false, string.Empty);

            _CreatureList.Add(info);
        }

        // 전에 보냈던 크리쳐가 있으면 다시 정렬.
        for (int i = 0; i < m_DispatchRecvData.vCreatureKey.Count; i++)
        {
            foreach (CreatureItemInfo info in _CreatureList)
            {
                if (m_DispatchRecvData.vCreatureKey[i] == info.CreatureKey)
                {
                    CreatureItemInfo oldInfo = info;
                    _CreatureList.Remove(info);
                    _CreatureList.Insert(i, oldInfo);       // 전에 보냈던 순서대로 Insert
                    break;
                }
            }
        }
    }