示例#1
0
    private void InitDispatchTeamCreature()
    {
        for (int i = 0; i < m_DispatchTeamSlotList.Count; ++i)
        {
            DispatchTeamSlot slot = m_DispatchTeamSlotList[i];
            if (slot == null)
            {
                continue;
            }

            if (slot.CreatureIcon != null)
            {
                DestroyImmediate(slot.CreatureIcon.gameObject);
            }

            UIEventListener.Get(slot.CloseButton).onClick -= OnDispatchTeamSlotClose;
            UIEventListener.Get(slot.SlotObj).onClick     -= OnDispatchSlotClick;
            UIEventListener.Get(slot.CloseButton).onClick  = OnDispatchTeamSlotClose;
            UIEventListener.Get(slot.SlotObj).onClick      = OnDispatchSlotClick;

            // 첫번째 슬롯
            if (slot.iNum == 1)
            {
                slot.SetActiveSelect(true);
            }
            else
            {
                slot.SetActiveSelect(false);
            }
        }
    }
示例#2
0
    //===================================================================================
    //
    // Event
    //
    //===================================================================================
    private void OnDispatchTeamSlotClose(GameObject go)
    {
        if (go != null)
        {
            SoundManager.Instance.PlayFX(enSoundFXUI.BUTTON_MEDIUM);
        }

        int iDispatchTeamSlotCount = m_DispatchTeamSlotList.Count;

        for (int i = 0; i < iDispatchTeamSlotCount; ++i)
        {
            DispatchTeamSlot slot = m_DispatchTeamSlotList[i];
            if (slot == null)
            {
                continue;
            }

            if (slot.CloseButton == go)
            {
                DestroyDispatchTeamCreature(slot);
                slot.SetActiveSelect(true);

                if (i < iDispatchTeamSlotCount - 1)
                {
                    SetSlotType(enDispatchTeamSlotType.Creature);
                }
                else
                {
                    SetSlotType(enDispatchTeamSlotType.Friend);

                    for (int k = 0; k < _FriendList.Count; ++k)        // 친구슬롯이면 선택된것들 다 해제.
                    {
                        DispatchTeamItemFriend friendItem = _FriendList[k];
                        if (friendItem == null)
                        {
                            continue;
                        }

                        friendItem.SetActiveSelect(false);
                    }
                }
            }
            else
            {
                slot.SetActiveSelect(false);
            }
        }
    }
示例#3
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);
                    }
                }
            }
        }
    }
示例#4
0
    private void OnDispatchSlotClick(GameObject go)
    {
        if (go != null)
        {
            SoundManager.Instance.PlayFX(enSoundFXUI.BUTTON_MEDIUM);
        }

        int iDispatchTeamSlotCount = m_DispatchTeamSlotList.Count;

        for (int i = 0; i < iDispatchTeamSlotCount; ++i)
        {
            DispatchTeamSlot slot = m_DispatchTeamSlotList[i];
            if (slot == null)
            {
                continue;
            }

            if (slot.SlotObj == go)
            {
                if (i < iDispatchTeamSlotCount - 1)
                {
                    SetSlotType(enDispatchTeamSlotType.Creature);
                }
                else
                {
                    SetSlotType(enDispatchTeamSlotType.Friend);
                }

                slot.SetActiveSelect(true);
            }
            else
            {
                slot.SetActiveSelect(false);
            }
        }
    }
示例#5
0
    private void OnDispatchFriendListClose(GameObject go)
    {
        if (go != null)
        {
            SoundManager.Instance.PlayFX(enSoundFXUI.BUTTON_MEDIUM);
        }

        SetSlotType(enDispatchTeamSlotType.Creature);

        int iDispatchTeamSlotCount = m_DispatchTeamSlotList.Count;

        for (int i = 0; i < iDispatchTeamSlotCount; ++i)
        {
            DispatchTeamSlot slot = m_DispatchTeamSlotList[i];
            if (slot == null)
            {
                continue;
            }

            slot.SetActiveSelect(false);
        }

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

            if (slot.CreatureIcon == null)
            {
                slot.SetActiveSelect(true);
                break;
            }
        }
    }
示例#6
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);
                    }
                }
            }
        }
    }