Example #1
0
    /// <summary>
    /// 크리쳐 아이콘 프리팹에는 패널을 붙이지 않아서 패널을 붙이고 싶을때 쓰임.
    /// iParentPanelDepth 인자로 부모 패널의 뎁스를 꼭 넣어주자...
    /// </summary>
    /// <param name="iPanelDepth"></param>
    public void AddPanel(int iParentPanelDepth)
    {
        UIPanel uiParentPanel = UtilFunc.GetParentPanel(transform);

        if (uiParentPanel != null)
        {
            iParentPanelDepth = uiParentPanel.depth;
        }

        UIPanel uiPanel = gameObject.GetComponent <UIPanel>();

        if (uiPanel == null)
        {
            uiPanel = gameObject.AddComponent <UIPanel>();
        }

        UtilFunc.SetPanelDepth(uiPanel, iParentPanelDepth + 10);
    }
Example #2
0
    private void CreateItemIcon(List <PvPItemInfo> items)
    {
        ClearItemIcon();

        for (int i = 0; i < items.Count; i++)
        {
            PvPItemInfo info = items[i];

            CItem citem = new CItem();
            citem.m_ItemID  = info.ItemID;
            citem.m_ItemKey = info.ItemKey;

            citem.m_ItemOptions = new _vItemOptions();

            for (int k = 0; k < info.options.Count; k++)
            {
                PvPItemOptionInfo optioninfo = info.options[k];

                CItemOption citemoption = new CItemOption();
                citemoption.m_OptionNo      = optioninfo.optionNo;
                citemoption.m_OptionID      = optioninfo.optionID;
                citemoption.m_OptionCreator = optioninfo.optionCreator;
                citemoption.m_OptionInt     = optioninfo.optionInt;
                citemoption.m_OptionBigint  = optioninfo.optionBigint;

                citem.m_ItemOptions.Add(citemoption);
            }

            DATA_ITEM_NEW itemTable = CDATA_ITEM_NEW.Get(info.ItemID);

            Transform parent = null;

            if (itemTable.m_enItemSubType == DATA_ITEM_SUB_TYPE_NEW._enItemStatusSubType.ITEMTYPE_EI_WEAPON)
            {
                parent = _itemIconTransforms[(int)enCreatureItemType.ITEMCREATUETYPE_WEAPON];
            }
            else if (itemTable.m_enItemSubType == DATA_ITEM_SUB_TYPE_NEW._enItemStatusSubType.ITEMTYPE_EI_ARMOR)
            {
                parent = _itemIconTransforms[(int)enCreatureItemType.ITEMCREATUETYPE_ARMOR];
            }
            else if (itemTable.m_enItemSubType == DATA_ITEM_SUB_TYPE_NEW._enItemStatusSubType.ITEMTYPE_EI_ACCESSORY)
            {
                parent = _itemIconTransforms[(int)enCreatureItemType.ITEMCREATUETYPE_ACC1];
            }
            else if (itemTable.m_enItemSubType == DATA_ITEM_SUB_TYPE_NEW._enItemStatusSubType.ITEMTYPE_EI_ACCESSORY_2)
            {
                parent = _itemIconTransforms[(int)enCreatureItemType.ITEMCREATUETYPE_ACC2];
            }

            ItemBaseIcon icon = UIResourceMgr.CreatePrefab <ItemBaseIcon>(BUNDLELIST.PREFABS_UI_COMMON, parent, "ItemBaseIcon");

            UIPanel iconPanel = icon.GetComponent <UIPanel>();
            if (iconPanel != null)
            {
                if (_panel != null)
                {
                    UtilFunc.SetPanelDepth(iconPanel, _panel.depth + 10);
                }
                else
                {
                    UtilFunc.SetPanelDepth(iconPanel, 410);
                }
            }

            TweenScale tweenscale = icon.GetComponent <TweenScale>();
            if (tweenscale != null)
            {
                DestroyImmediate(tweenscale);
            }

            uint ItemForce = info.ItemForce;

            ItemSlot slot = new ItemSlot(citem);
            slot.SetUpgradeLevel((int)ItemForce);

            icon.Init(itemTable, slot);
            icon.SetForceCount((int)ItemForce);
            icon.ActiveGoldBuffIcon(false);

            _itemIconList.Add(icon);
        }
    }
Example #3
0
 public void SetScrollViewDepth(int parentDepth)
 {
     UtilFunc.SetPanelDepth(_scrollView.panel, parentDepth + 5);
 }
Example #4
0
    private void SetDispatchButton(bool bDispatchSuccess, TimeSpan TimeResult)
    {
        m_SuccessObj.SetActive(false);
        _BigSuccessObj.SetActive(false);

        if (bDispatchSuccess == false /*&& m_DispatchRecvData.kDispatchState == _enDispatchState.eDispatchState_INPROGRESSING*/)
        {
            m_RewardButton.SetActive(false);

            m_CloseButton.SetActive(true);
            m_ProgressButton.SetActive(true);

            TimeSpan tsTotalGap = m_DispatchEndTime - m_DispatchStartTime;
            //TimeSpan tsCurrGap = TimeResult;

            double fPercent = TimeResult.TotalMilliseconds / tsTotalGap.TotalMilliseconds;
            if (fPercent > 1f)
            {
                fPercent = 1f;
            }
            else if (fPercent < 0f)
            {
                fPercent = 0f;
            }

            m_QuickCost = (int)(m_DispatchTableData.QuickCost * fPercent);
            m_ImmediatelyCompleteCountLabel.text = m_QuickCost.ToString();

            m_ProgressGageSprite.fillAmount = 1 - (float)(TimeResult.TotalSeconds / (m_DispatchTableData.RequireTime * 60));

            if (TimeResult.Hours > 0)
            {
                // 4915	{0}시간 {1}분 남음
                m_ProgressGageLabel.text = string.Format(StringTableManager.GetData(4915), TimeResult.Hours, TimeResult.Minutes);
            }
            else if (TimeResult.Minutes > 0)
            {
                // 4916	{0}분 남음
                m_ProgressGageLabel.text = string.Format(StringTableManager.GetData(4916), TimeResult.Minutes);
            }
            else if (TimeResult.Seconds > 0)
            {
                // 4959	1분 미만
                m_ProgressGageLabel.text = StringTableManager.GetData(4959);
            }
        }
        else if (bDispatchSuccess == true /*&& m_DispatchRecvData.kDispatchState == _enDispatchState.eDispatchState_COMPLETE*/)
        {
            m_CloseButton.SetActive(false);
            m_ProgressButton.SetActive(false);

            m_RewardButton.SetActive(true);

            UIPanel SuccessPanel = null;
            if (m_DispatchRecvData.kDispatchState == _enDispatchState.eDispatchState_BIGCOMPLETE)
            {
                _BigSuccessObj.SetActive(true);
                SuccessPanel = _BigSuccessObj.GetComponent <UIPanel>();

                m_RewardButtonLabel.text = StringTableManager.GetData(6727); // 6727	보상 수령 X2.
            }
            else
            {
                m_SuccessObj.SetActive(true);
                SuccessPanel = m_SuccessObj.GetComponent <UIPanel>();

                m_RewardButtonLabel.text = StringTableManager.GetData(6726); // 6726	보상 수령.
            }

            // 크리쳐 아이콘 뎁스 =  m_iPanelDepth + 1
            // 크리쳐 아이콘 뎁스보다 높아야 하기때문에 뎁스를 높인다.
            if (m_CreatureIconList.Count > 1)
            {
                UIPanel IconPanel = m_CreatureIconList[0].GetComponent <UIPanel>();
                UtilFunc.SetPanelDepth(SuccessPanel, IconPanel.depth + 1);
            }
        }
    }