Esempio n. 1
0
    private void OnClickFriendItem(GameObject go)
    {
        if (go != null)
        {
            SoundManager.Instance.PlayFX(enSoundFXUI.BUTTON_MEDIUM);
        }

        for (int i = 0; i < _FriendList.Count; ++i)
        {
            DispatchTeamItemFriend friendItem = _FriendList[i];
            if (friendItem == null)
            {
                continue;
            }

            friendItem.SetActiveSelect(false);

            if (friendItem.gameObject == go)
            {
                if (friendItem.bDispatching == true)
                {
                    // 6747	친구 지원       // 6748	친구의 크리처는 1일 1회만 사용할 수 있습니다.
                    SystemPopupWindow.Instance.SetSystemPopup(enSystemPopupType.Ok, StringTableManager.GetData(6747), StringTableManager.GetData(6748));

                    if (m_SelectFriend != null)
                    {
                        m_SelectFriend.SetActiveSelect(true);
                    }

                    break;
                }
                else
                {
                    friendItem.SetActiveSelect(true);
                    m_SelectFriend = friendItem;

                    DispatchTeamSlot slot = m_DispatchTeamSlotList[m_DispatchTeamSlotList.Count - 1];       // 친구슬롯.
                    if (slot != null)
                    {
                        if (slot.CreatureIcon != null)
                        {
                            DestroyDispatchTeamCreature(slot);
                        }

                        SetTeamCount(1);

                        CreatureIcon creatureIcon = UIResourceMgr.CreatePrefab <CreatureIcon>(BUNDLELIST.PREFABS_UI_COMMON, slot.SlotObj.transform, "CreatureIcon");
                        creatureIcon.SetIcon(friendItem.FriendInfo.kCreatureID, enCreatureIcon_Type.DispatchDisplayFriend);
                        creatureIcon.CreatureKey = friendItem.FriendInfo.kFriendCharNo;
                        creatureIcon.AddPanel(m_iPanelDepth);
                        creatureIcon.RemoveBoxCollider();

                        slot.CreatureIcon = creatureIcon;
                        slot.SetActiveSelect(false);
                    }
                }
            }
        }
    }
Esempio n. 2
0
    private void SetDispatchInfo()
    {
        //m_DispatchTableData = CDATA_DISPATCH.Get(m_DispatchRecvData.kMissionCategory, m_DispatchRecvData.kDispatchSubID);
        if (m_DispatchTableData == null)
        {
            return;         // error.
        }
        // top
        {
            // 임무이름.
            m_DispatchDescLabel.text = StringTableManager.GetData(int.Parse(m_DispatchTableData.String_Name));

            // 6847    Lv {0} 이상 {1}성 이상
            m_DispatchContentLabel.text = string.Format(StringTableManager.GetData(6847), m_DispatchTableData.RequireLevel, (int)m_DispatchTableData.RequireGrade);
        }

        // middle
        {
            DestroyCreatureIcon();

            int iCount = m_DispatchRecvData.vCreatureKey.Count;
            for (int i = 0; i < iCount; ++i)
            {
                ulong kCreatureKey = m_DispatchRecvData.vCreatureKey[i];
                if (kCreatureKey == 0)
                {
                    continue;
                }

                CreatureIcon icon = UIResourceMgr.CreatePrefab <CreatureIcon>(BUNDLELIST.PREFABS_UI_COMMON, m_SlotList[i].transform, "CreatureIcon");
                icon.SetIcon(kCreatureKey, enCreatureIcon_Type.DispatchDisplay);
                icon.AddPanel(m_iPanelDepth);
                icon.RemoveBoxCollider();

                m_CreatureIconList.Add(icon);
            }

            //if(m_DispatchRecvData.kFriendCreatureID != DATA_CREATURE_NEWVER._enIndex.CREATURE_NONE)
            if (m_DispatchRecvData.kFriendCreatureID != 0)
            {
                CreatureIcon icon = UIResourceMgr.CreatePrefab <CreatureIcon>(BUNDLELIST.PREFABS_UI_COMMON, m_SlotList[m_SlotList.Count - 1].transform, "CreatureIcon");
                icon.SetIcon(m_DispatchRecvData.kFriendCreatureID, enCreatureIcon_Type.DispatchDisplayFriend);
                icon.AddPanel(m_iPanelDepth);
                icon.RemoveBoxCollider();

                m_CreatureIconList.Add(icon);
            }
        }

        // bottom
        {
            //SetDispatchButton(m_DispatchTableData);
        }
    }
Esempio n. 3
0
    private void SetDispatchCreature(CreatureIcon CreatureListIcon)
    {
        int iDispatchTeamSlotCount = m_DispatchTeamSlotList.Count - 1;

        if (CreatureListIcon.IsDispatchSelect == false)                    // 크리쳐를 추가할때
        {
            bool bAddCreature = false;
            for (int i = 0; i < iDispatchTeamSlotCount; ++i)
            {
                DispatchTeamSlot slot = m_DispatchTeamSlotList[i];
                if (slot == null)
                {
                    continue;
                }

                if (slot.bSelect == true)
                {
                    if (slot.CreatureIcon != null)
                    {
                        DestroyDispatchTeamCreature(slot);
                    }

                    SetTeamCount(1);

                    CreatureIcon creatureIcon = UIResourceMgr.CreatePrefab <CreatureIcon>(BUNDLELIST.PREFABS_UI_COMMON, slot.SlotObj.transform, "CreatureIcon");
                    creatureIcon.SetIcon(CreatureListIcon.CreatureKey, enCreatureIcon_Type.DispatchDisplay);
                    creatureIcon.AddPanel(m_iPanelDepth);
                    creatureIcon.RemoveBoxCollider();

                    slot.CreatureIcon = creatureIcon;
                    slot.SetActiveSelect(false);

                    CreatureListIcon.SetDispatchSelectNumberLabel(slot.iNum.ToString());
                    CreatureListIcon.SetActiveDispatchSelect(true);

                    bAddCreature = true;
                    break;
                }
            }

            if (bAddCreature == true)
            {
                for (int i = 0; i < iDispatchTeamSlotCount; ++i)                // 다음 선택될 칸을 지정한다.
                {
                    DispatchTeamSlot slot = m_DispatchTeamSlotList[i];
                    if (slot == null)
                    {
                        continue;
                    }

                    if (slot.CreatureIcon == null)
                    {
                        slot.SetActiveSelect(true);
                        break;
                    }
                }
            }
        }
        else if (CreatureListIcon.IsDispatchSelect == true)                // 추가된 크리쳐를 뺄때
        {
            for (int i = 0; i < iDispatchTeamSlotCount; ++i)
            {
                DispatchTeamSlot slot = m_DispatchTeamSlotList[i];
                if (slot == null)
                {
                    continue;
                }

                slot.SetActiveSelect(false);

                if (slot.CreatureIcon != null)
                {
                    if (slot.CreatureIcon.CreatureKey == CreatureListIcon.CreatureKey)
                    {
                        CreatureListIcon.SetActiveDispatchSelect(false);
                        DestroyDispatchTeamCreature(slot);
                        slot.SetActiveSelect(true);
                    }
                }
            }
        }
    }