示例#1
0
    /// <summary>
    /// Rmi_DispatchCancel(_stDispatchCancelAck stAck) 패킷 받음.
    /// Rmi_DispatchFast(_stDispatchFastAck stAck) 패킷 받음.
    /// </summary>
    /// <param name="stAck"></param>
    public bool SetDispatchCardEmpty(byte kTeamIndex)
    {
        for (int i = 0; i < m_DispatchCardList.Count; ++i)
        {
            DispatchCardItem cardItem = m_DispatchCardList[i];
            if (cardItem == null)
            {
                continue;
            }

            if (kTeamIndex == cardItem.DispatchRecvData.kTeamIndex)
            {
                cardItem.SetCard(OnClickDispatchCard);
                return(true);
            }
        }

        return(false);
    }
示例#2
0
    //===================================================================================
    //
    // Default Method
    //
    //===================================================================================
    public override void Init()
    {
        m_TitleLabel.text        = StringTableManager.GetData(6722);            // 6722	파견
        m_TitleContentLabel.text = StringTableManager.GetData(6723);            // 6723	임무 카드

        // 서버에 값이 있는 만큼만 생성하고 없으면 empty 슬롯으로 초기화.
        _stDispatchInfoAck stDispatchInfoAck = UserInfo.Instance.DispatchInfoAck;

        if (stDispatchInfoAck == null)
        {
#if DEBUG_LOG
            Debug.LogError("서버에서 파견정보 안줌!! - UserInfo.Instance.DispatchInfoAck is NULL");
#endif
            return;     // error;
        }

        _vDispatch vDispatch = stDispatchInfoAck.vDispatch;
        if (vDispatch == null)
        {
#if DEBUG_LOG
            Debug.LogError("서버에서 파견정보 안줌!! - stDispatchInfoAck.vDispatch is NULL");
#endif
            return;     // error;
        }

        DestroyDispatchCard();

        int iPanelDepth = m_DispatchCardScrollView.panel.depth;

        vDispatch.Sort((a, b) => a.kTeamIndex.CompareTo(b.kTeamIndex));
        for (int i = 0; i < vDispatch.Count; ++i)
        {
            CDispatch Dispatch = vDispatch[i];
            if (Dispatch == null)
            {
#if DEBUG_LOG
                Debug.LogError(string.Format("서버에서 파견정보 안줌!! - stDispatchInfoAck.vDispatch Number : {0} is NULL", i));
#endif
                continue;
            }

            DispatchCardItem cardItem = UIResourceMgr.CreatePrefab <DispatchCardItem>(BUNDLELIST.PREFABS_UI_DISPATCH, m_DispatchCardGrid.transform, "DispatchCardItem");
            cardItem.Init(Dispatch);

            if (Dispatch.kDispatchState == _enDispatchState.eDispatchState_None)     // 빈 카드 생성.
            {
                cardItem.SetCard(OnClickDispatchCard);
            }
            else                                                                            // 진행중, 성공, 대성공 카드 생성.
            {
                cardItem.SetCard(iPanelDepth);
            }

            m_DispatchCardList.Add(cardItem);
        }

        ResetPosition();

#if TUTORIAL
        SetTutorialButtonEvent();
#endif
    }