Пример #1
0
    /// <summary> OwnDetailInfo를 실행하는 함수 </summary>
    public void SetPartnerInfo(NetData._PartnerData data, int openView = (int)ViewType.Attribute)
    {
        if (ModelRoot.childCount > 0)
        {
            DestroyImmediate(ModelRoot.GetChild(0).gameObject);
        }

        UIHelper.CreatePartnerUIModel(ModelRoot, data._partnerDataIndex, 3, true, false, "PartnerPanel");
        ModelRoot.localEulerAngles = Vector3.zero;

        string lvStr = string.Format(_LowDataMgr.instance.GetStringCommon(453), data._NowLevel);

        Name.text   = data.GetLocName();
        Damage.text = string.Format(_LowDataMgr.instance.GetStringCommon(1163), data._Attack);

        GradeLabel.text = string.Format("{0}{1}[-]", UIHelper.GetItemGradeColor((int)data.CurQuality), data.GetGradeName());

        Transform skillTab = TabBtn[1].transform;
        Transform upTab    = TabBtn[2].transform;

        if (data._isOwn)
        {
            if (data._NowLevel >= data._MaxLevel)
            {
                Level.text = string.Format(_LowDataMgr.instance.GetStringCommon(1152), data._NowLevel);
            }
            else
            {
                Level.text = string.Format(_LowDataMgr.instance.GetStringCommon(1151), data._NowLevel);
            }
        }
        else
        {
            Level.text = string.Format(_LowDataMgr.instance.GetStringCommon(1151), 1);
        }

        CurData = data;
        CheckMoveState(openView);

        transform.FindChild("Info/Mark").GetComponent <UISprite>().spriteName = CurData.GetClassType();

        OnClickTabList(openView);
        //TabGroup.CoercionTab(openView);

        skillTab.GetComponent <BoxCollider>().enabled = data._isOwn;
        upTab.GetComponent <BoxCollider>().enabled    = data._isOwn;

        skillTab.transform.FindChild("tab_off").gameObject.SetActive(data._isOwn);
        skillTab.transform.FindChild("tab_disable").gameObject.SetActive(!data._isOwn);
        upTab.transform.FindChild("tab_off").gameObject.SetActive(data._isOwn);
        upTab.transform.FindChild("tab_disable").gameObject.SetActive(!data._isOwn);

        //중심축때문에..
        //파트너 모델링의 x 좌표만큼 상위의 ModelPos에더해줌.
        ModelRoot.SetLocalX(ModelRootX + ModelRoot.GetChild(0).transform.localPosition.x);
        ModelRoot.GetChild(0).transform.SetLocalX(0);

        if (SceneManager.instance.CurTutorial == TutorialType.PARTNER)
        {
            TabBtn[1].gameObject.GetComponent <TutorialSupport>().OnTutoSupportStart();
        }
    }
Пример #2
0
    void InitAttribute()
    {
        string lvStr = string.Format(_LowDataMgr.instance.GetStringCommon(453), CurData._NowLevel);

        Name.text   = CurData.GetLocName();
        Damage.text = string.Format(_LowDataMgr.instance.GetStringCommon(1163), CurData._Attack);

        GradeLabel.text = string.Format("{0}{1}[-]", UIHelper.GetItemGradeColor((int)CurData.CurQuality), CurData.GetGradeName());

        if (CurData._isOwn)
        {
            if (CurData._NowLevel >= CurData._MaxLevel)
            {
                Level.text = string.Format(_LowDataMgr.instance.GetStringCommon(1152), CurData._NowLevel);
            }
            else
            {
                Level.text = string.Format(_LowDataMgr.instance.GetStringCommon(1151), CurData._NowLevel);
            }
        }
        else
        {
            Level.text = string.Format(_LowDataMgr.instance.GetStringCommon(1151), 1);
        }

        transform.FindChild("Info/Mark").GetComponent <UISprite>().spriteName = CurData.GetClassType();

        Dictionary <AbilityType, float> abilityDic = NetData.instance.CalcPartnerStats(CurData._NowLevel, CurData.GetLowData(), CurData.CurQuality);


        float maxExp = CurData._MaxExp;

        AttStateSlider[0].value = 1;
        AttStateSlider[1].value = 1;

        AttStateValue[0].text = string.Format("{0} / {1}", Mathf.FloorToInt(abilityDic[AbilityType.HP]), Mathf.FloorToInt(abilityDic[AbilityType.HP]));
        AttStateValue[1].text = string.Format("{0} / {1}", Mathf.FloorToInt(abilityDic[AbilityType.SUPERARMOR]), Mathf.FloorToInt(abilityDic[AbilityType.SUPERARMOR]));



        //어빌리티 정보 셋팅
        int length = AttAbilitys.Length;

        for (int i = 0; i < length; i++)
        {
            float       value = 0;
            AbilityType a     = (AbilityType)i + 1;
            abilityDic.TryGetValue(a, out value);

            AttAbilitys[i].text = UIMgr.instance.GetAbilityStrValue(a, value);
        }
    }
    /// <summary>
    /// Partner를 셋팅 및 보여준다.
    /// </summary>
    /// <param name="type">PartnerType으로 타입에 맞게 보여줌</param>
    int OnTabPartnerList(int typeIdx)
    {
        PartnerClassType type = (PartnerClassType)typeIdx;
        int gridSlotCount     = 0;

        bool isTuto = SceneManager.instance.CurTutorial == TutorialType.PARTNER;
        List <NetData._PartnerData> dataList = CharInven.GetPartnerList();
        int loopCount = dataList.Count;

        for (int i = 0; i < loopCount; i++)
        {
            ListGridTf.GetChild(i).gameObject.SetActive(false);

            NetData._PartnerData    data = dataList[i];
            Partner.PartnerDataInfo info = data.GetLowData();
            if (type != PartnerClassType.None && (PartnerClassType)info.Class != type)
            {
                continue;
            }

            Transform slotTf = ListGridTf.GetChild(gridSlotCount);
            slotTf.gameObject.SetActive(true);


            slotTf.FindChild("Mark").GetComponent <UISprite>().spriteName = data.GetClassType();
            //보유조각수
            slotTf.FindChild("Txt_count").GetComponent <UILabel>().text = string.Format(_LowDataMgr.instance.GetStringCommon(1154), data.NowShard, data._needShard);


            UISprite face = slotTf.FindChild("Itemroot/face").GetComponent <UISprite>();
            UISprite bg   = slotTf.FindChild("Itemroot/gradebg").GetComponent <UISprite>();
            face.spriteName = data.GetIcon();
            slotTf.FindChild("Txt_name").GetComponent <UILabel>().text = data.GetLocName();

            UILabel level = slotTf.FindChild("Txt_class").GetComponent <UILabel>();

            //등급은 색상도 고려해줘..
            UILabel gradeLabel = slotTf.FindChild("Txt_type").GetComponent <UILabel>();

            slotTf.FindChild("Itemroot/grade").GetComponent <UISprite>().spriteName = string.Format("Icon_0{0}", data.CurQuality);
            bg.spriteName = string.Format("Icon_bg_0{0}", data.CurQuality);

            Transform  btnGetTf    = slotTf.FindChild("Btn_Get");                 //소환버튼
            GameObject btnGetAfter = slotTf.FindChild("Btn_Getafter").gameObject; //보유중일때나옴
            btnGetAfter.SetActive(data._isOwn);
            btnGetTf.gameObject.SetActive(!data._isOwn);
            slotTf.FindChild("bg_on").gameObject.SetActive(data._isOwn);//배경

            if (data._isOwn)
            {
                EventDelegate.Set(btnGetAfter.GetComponent <UIEventTrigger>().onClick, delegate() {
                    UIMgr.instance.AddPopup(141, 1177, 117);    //보유중알림메시지
                });

                if (data._NowLevel >= data._MaxLevel)//최대렙
                {
                    level.text = string.Format(_LowDataMgr.instance.GetStringCommon(1152), data._NowLevel);
                }
                else
                {
                    level.text = string.Format(_LowDataMgr.instance.GetStringCommon(1151), data._NowLevel);
                }

                //색상도고려
                gradeLabel.text = string.Format("{0}{1}[-]", UIHelper.GetItemGradeColor((int)data.CurQuality), data.GetGradeName());
            }
            else
            {
                if (isTuto && type == PartnerClassType.Attack && data.NowShard >= data._needShard)
                {
                    isTuto = false;
                    TutorialSupport support = btnGetTf.gameObject.AddComponent <TutorialSupport>();
                    support.TutoType = TutorialType.PARTNER;
                    support.SortId   = 3;
                    support.IsScroll = true;

                    //support.NextTuto = OwnPartnerView.TabBtn[1].gameObject.GetComponent<TutorialSupport>();
                    support.OnTutoSupportStart();
                }

                btnGetTf.FindChild("Btn_on").gameObject.SetActive(data.NowShard >= data._needShard);
                btnGetTf.FindChild("Btn_off").gameObject.SetActive(data.NowShard < data._needShard);

                level.text      = "";
                gradeLabel.text = _LowDataMgr.instance.GetStringCommon(1155);                                                                   //없으면 미보유
                EventDelegate.Set(btnGetTf.GetComponent <UIEventTrigger>().onClick, delegate() { OnClickPartnerGet(data._partnerDataIndex); }); //소환
            }

            //슬롯 클릭시 실행할 함수 셋팅
            EventDelegate.Set(slotTf.GetComponent <UIEventTrigger>().onClick, delegate() {
                OnClickListSlot(data._partnerDataIndex);
            });

            ++gridSlotCount;
        }

        ListGridTf.GetComponent <UIGrid>().repositionNow = true;

        return(gridSlotCount);
    }