コード例 #1
0
    /// <summary> 사용 아이템의 설명문 Equip아이템은 아님. 마지막 셋팅 함수임. Position은 주지 않는다 </summary>
    void SetDesc(NetData._ItemData itemData, ref byte optionCount)
    {
        uint descId = 0;

        if (itemData.IsEquipItem())
        {
            Item.EquipmentInfo equipLowData = itemData.GetEquipLowData();
            descId = equipLowData.DescriptionId;
        }
        else
        {
            Item.ItemInfo useLowData = itemData.GetUseLowData();
            descId = useLowData == null ? 0 : useLowData.DescriptionId;
        }

        if (descId <= 0)
        {
            Desc.gameObject.SetActive(false);
            return;
        }

        ++optionCount;
        Desc.gameObject.SetActive(true);
        Desc.text = _LowDataMgr.instance.GetStringItem(descId);
    }
コード例 #2
0
    void getModelInfo(NetData._UserInfo inven, ref uint HELMETID, ref uint CLOTHID, ref uint WEAPONID, ref uint CostumeID)
    {
        Item.EquipmentInfo tempInfo = inven.GetEquipPartsLowData(ePartType.HELMET);
        if (tempInfo == null)
        {
            HELMETID = 0;
        }
        else
        {
            HELMETID = tempInfo.Id;
        }

        tempInfo = inven.GetEquipPartsLowData(ePartType.CLOTH);
        if (tempInfo == null)
        {
            CLOTHID = 0;
        }
        else
        {
            CLOTHID = tempInfo.Id;
        }

        tempInfo = inven.GetEquipPartsLowData(ePartType.WEAPON);
        if (tempInfo == null)
        {
            WEAPONID = 0;
        }
        else
        {
            WEAPONID = tempInfo.Id;
        }

        NetData._CostumeData tempCostume = inven.GetEquipCostume();

        if (tempCostume == null)
        {
            if (inven.GetCharIdx() == 11000)
            {
                CostumeID = 100;
            }
            else if (inven.GetCharIdx() == 12000)
            {
                CostumeID = 110;
            }
            else if (inven.GetCharIdx() == 13000)
            {
                CostumeID = 120;
            }
        }
        else
        {
            CostumeID = tempCostume._costmeDataIndex;
        }
    }
コード例 #3
0
    void ShowItem(NetData._ItemData recomend)
    {
        Name.text = recomend.GetLocName();
        Item.EquipmentInfo equipLowData = recomend.GetEquipLowData();
        Img.spriteName   = _LowDataMgr.instance.GetLowDataIcon(equipLowData.Icon);
        Bg.spriteName    = string.Format("Icon_bg_0{0}", equipLowData.Grade);
        Grade.spriteName = string.Format("Icon_0{0}", equipLowData.Grade);
        Attack.text      = string.Format("{0} : {1}", _LowDataMgr.instance.GetStringCommon(47), recomend._Attack.ToString());

        //UIEventTrigger etri = transform.FindChild("Bg").GetComponent<UIEventTrigger>();
        //EventDelegate.Set(etri.onClick, delegate () { OnclicItemPopup(Img.transform, recomend._equipitemDataIndex); });

        if (SceneManager.instance.testData.bSingleSceneTestStart || SceneManager.instance.testData.bQuestTestStart)
        {
            TempCoroutine.instance.FrameDelay(0.5f, () => {
                OnClickChanged();
            });
        }
    }
コード例 #4
0
    /// <summary> 장비 아이템 </summary>
    void SetEquipItem(Item.EquipmentInfo lowData, uint amount)
    {
        if (lowData == null)
        {
            return;
        }

        ItemIcon.atlas   = _AtlasMgr.GetEquipAtlasForClassId(lowData.Class);
        BackGround.atlas = _AtlasMgr.GetLoadAtlas(LoadAtlasType.Item);

        //if (ItemIcon.atlas != EquipAtlas)
        //    ItemIcon.atlas = EquipAtlas;

        //if (BackGround.atlas != EquipAtlas)
        //    BackGround.atlas = EquipAtlas;

        DefaultBg.gameObject.SetActive(false);

        string icon = _LowDataMgr.instance.GetLowDataIcon(lowData.Icon), gradeIcon = GetGradeIcon(lowData.Grade);
        string bg = string.Format("Icon_bg_0{0}", lowData.Grade);

        SetDefault(icon, gradeIcon, amount, bg);
    }
コード例 #5
0
    /// <summary> 아이템 기본 정보를 보여준다. </summary>
    public override void LateInit()
    {
        base.LateInit();
        if (parameters.Length <= 0)
        {
            return;
        }

        uint    lowDataId = (uint)parameters[0];
        Vector3 newPos    = (Vector3)parameters[1];

        newPos.z  = 0;
        newPos.y += 0.15f;
        //newPos.x += 0.35f;

        Debug.Log(string.Format("click item lowDataID {0}", lowDataId));


        EquipItemTf.position = newPos;
        UseItemTf.position   = newPos;

        InvenSlot.SetLowDataItemSlot(lowDataId, 0);

        Item.EquipmentInfo equipLowData = _LowDataMgr.instance.GetLowDataEquipItemInfo(lowDataId);
        if (equipLowData != null)//장비 아이템이다.
        {
            EquipItemTf.gameObject.SetActive(true);
            UseItemTf.gameObject.SetActive(false);
            InvenSlot.transform.parent = EquipItemTf.FindChild("ItemRoot");

            Item.ItemValueInfo valueLowData = _LowDataMgr.instance.GetLowDataItemValueInfo(equipLowData.BasicOptionIndex);
            UILabel            nameLbl      = EquipItemTf.FindChild("name").GetComponent <UILabel>();
            UILabel            descLbl      = EquipItemTf.FindChild("desc").GetComponent <UILabel>();
            UILabel            abilityLbl   = EquipItemTf.FindChild("ability_value").GetComponent <UILabel>();
            UILabel            rndLbl       = EquipItemTf.FindChild("rnd_ability").GetComponent <UILabel>();

            nameLbl.text    = string.Format("{0}{1}[-]", UIHelper.GetItemGradeColor(equipLowData.Grade), _LowDataMgr.instance.GetStringItem(equipLowData.NameId));
            descLbl.text    = _LowDataMgr.instance.GetStringItem(equipLowData.DescriptionId);
            abilityLbl.text = string.Format("{0} : {1}", uiMgr.GetAbilityLocName((AbilityType)valueLowData.OptionId)
                                            , uiMgr.GetAbilityStrValue((AbilityType)valueLowData.OptionId, valueLowData.BasicValue * 0.1f));
            rndLbl.text = string.Format(_LowDataMgr.instance.GetStringCommon(179)
                                        , 0, 3);

            //생성되고 잘리는경우 위치값조정필요

            if (EquipItemTf.localPosition.x > 454)
            {
                EquipItemTf.SetLocalX(454f);
            }
            else if (EquipItemTf.localPosition.x < -447)
            {
                EquipItemTf.SetLocalX(-447f);
            }
        }
        else//소비 아이템이다.
        {
            EquipItemTf.gameObject.SetActive(false);
            UseItemTf.gameObject.SetActive(true);
            InvenSlot.transform.parent = UseItemTf.FindChild("ItemRoot");

            UILabel nameLbl = UseItemTf.FindChild("name").GetComponent <UILabel>();
            UILabel descLbl = UseItemTf.FindChild("desc").GetComponent <UILabel>();

            Item.ItemInfo useLowData = _LowDataMgr.instance.GetUseItem(lowDataId);
            nameLbl.text = string.Format("{0}{1}[-]", UIHelper.GetItemGradeColor(useLowData.Grade), _LowDataMgr.instance.GetStringItem(useLowData.NameId));

            descLbl.text = _LowDataMgr.instance.GetStringItem(useLowData.DescriptionId);

            //생성되고 잘리는경우 위치값조정필요
            if (UseItemTf.localPosition.x > 385)
            {
                UseItemTf.SetLocalX(385);
            }
            else if (UseItemTf.localPosition.x < -507)
            {
                UseItemTf.SetLocalX(-507);
            }
        }

        InvenSlot.transform.localPosition = Vector3.zero;
        InvenSlot.transform.localScale    = Vector3.one;
    }
コード例 #6
0
    public _PlayerSyncData OtherPcSyncData(ulong AccountUUID, ulong a_rUUID, string a_Nick, uint a_CharIdx, uint a_userCostumeIdx, uint a_userLevel, uint prefix, uint suffix, uint maxSuperArmor, uint skillSetId)
    {
        _PlayerSyncData otherPcSyncData = new _PlayerSyncData();
        //if (_playerSyncData == null)
        //    return;

        PlayerUnitData myData = new PlayerUnitData();

        Dictionary <AbilityType, float> playerStats = new Dictionary <AbilityType, float>();

        //기본 스탯 넣어주자
        uint iLevel = 1;

        //일단 기본캐릭만
        Character.CharacterInfo charInfo = _LowDataMgr.instance.GetCharcterData(11000);
        playerStats.Add(AbilityType.HP, (float)(charInfo.BaseHp + iLevel * _LowDataMgr.instance.GetFormula(FormulaType.LEVELUP_CALIBRATION, 1) * charInfo.LevelUpHp));
        playerStats.Add(AbilityType.DAMAGE, (float)(charInfo.BaseAtk + iLevel * _LowDataMgr.instance.GetFormula(FormulaType.LEVELUP_CALIBRATION, 1) * charInfo.LevelUpAtk));
        playerStats.Add(AbilityType.HIT_RATE, (float)(charInfo.BaseHit * 0.1f + iLevel * _LowDataMgr.instance.GetFormula(FormulaType.LEVELUP_CALIBRATION, 1) * charInfo.LevelHitRate));
        playerStats.Add(AbilityType.DODGE_RATE, (float)(charInfo.BaseAvoid * 0.1f + iLevel * _LowDataMgr.instance.GetFormula(FormulaType.LEVELUP_CALIBRATION, 1) * charInfo.LevelAvoidRate));
        playerStats.Add(AbilityType.CRITICAL_RATE, (float)(charInfo.BaseCriticalRate * 0.1f));
        playerStats.Add(AbilityType.CRITICAL_RES, (float)(charInfo.BaseCriticalResist * 0.1f));
        playerStats.Add(AbilityType.CRITICAL_DAMAGE, (float)(charInfo.BaseCriticalDamage * 0.1f));
        playerStats.Add(AbilityType.DRAIN_HP, (float)(charInfo.BaseLifeSteal * 0.1f));
        playerStats.Add(AbilityType.DEFENCE_IGNORE, (float)(charInfo.BaseIgnoreAtk));
        playerStats.Add(AbilityType.DAMAGE_DECREASE, (float)(charInfo.BaseDamageDown));
        playerStats.Add(AbilityType.DAMAGE_DECREASE_RATE, (float)(charInfo.BaseDamageDownRate * 0.1f));
        playerStats.Add(AbilityType.EXP_UP, 0f);
        playerStats.Add(AbilityType.ALLSTAT_RATE, 0f);
        playerStats.Add(AbilityType.SUPERARMOR, maxSuperArmor);
        playerStats.Add(AbilityType.SUPERARMOR_RECOVERY, (float)(charInfo.SuperArmorRecovery));
        playerStats.Add(AbilityType.SUPERARMOR_RECOVERY_RATE, (float)(charInfo.SuperArmorRecoveryRate));
        playerStats.Add(AbilityType.SUPERARMOR_RECOVERY_TIME, (float)(charInfo.SuperArmorRecoveryTime));

        /*
         * for (int i = 0; i < (int)ePartType.PART_MAX; i++)
         * _ItemData equipItem = GetUserInfo().GetEquipParts((ePartType)i);
         *
         * if (equipItem != null)
         * {
         * var enumerator = equipItem.Stats.GetEnumerator();
         * while (enumerator.MoveNext())
         * {
         *  if (playerStats.ContainsKey(enumerator.Current.Key))
         *  {
         *      //있는거면 더해주기
         *      playerStats[enumerator.Current.Key] += RealValue(enumerator.Current.Key, enumerator.Current.Value);
         *  }
         *  else
         *  {
         *      //없는거면 추가
         *      playerStats.Add(enumerator.Current.Key, RealValue(enumerator.Current.Key, enumerator.Current.Value));
         *  }
         *
         * }
         * }
         * }
         */

        uint HELMETID = 0;
        uint CLOTHID  = 0;
        uint WEAPONID = 0;

        Item.EquipmentInfo tempInfo = GetUserInfo().GetEquipPartsLowData(ePartType.HELMET);
        if (tempInfo == null)
        {
            HELMETID = 0;
        }
        else
        {
            HELMETID = tempInfo.Id;
        }

        tempInfo = GetUserInfo().GetEquipPartsLowData(ePartType.CLOTH);
        if (tempInfo == null)
        {
            CLOTHID = 0;
        }
        else
        {
            CLOTHID = tempInfo.Id;
        }

        tempInfo = GetUserInfo().GetEquipPartsLowData(ePartType.WEAPON);
        if (tempInfo == null)
        {
            WEAPONID = 0;
        }
        else
        {
            WEAPONID = tempInfo.Id;
        }

        //서버에서 정상적인 데이터 오기전까지는 일렇게.
        if (skillSetId <= 0)
        {
            switch (a_CharIdx)
            {
            case 11000:
                skillSetId = 100;
                break;

            case 12000:
                skillSetId = 200;
                break;

            case 13000:
                skillSetId = 300;
                break;
            }
        }

        myData.Init(0,
                    0,
                    a_Nick,
                    AccountUUID,
                    a_rUUID,
                    a_CharIdx,
                    0,
                    a_userCostumeIdx,
                    0,
                    0,
                    skillSetId,
                    false,
                    1,
                    prefix,
                    suffix,
                    playerStats);

        //Item.CostumeInfo costumeData = _LowDataMgr.instance.GetLowDataCostumeInfo(a_userCostumeIdx);

        uint skillIndex = 0;

        SkillTables.SkillSetInfo setInfo = _LowDataMgr.instance.GetLowDataSkillSet(skillSetId);
        for (int i = 0; i < setInfo.skill0.Count; i++)
        {
            uint.TryParse(setInfo.skill0[i], out skillIndex);
            myData.NormalAttackData[i] = new SkillData(skillIndex, (byte)1);
        }

        myData.SkillData[0] = new SkillData(setInfo.skill1, (byte)1);
        myData.SkillData[1] = new SkillData(setInfo.skill2, (byte)1);
        myData.SkillData[2] = new SkillData(setInfo.skill3, (byte)1);
        myData.SkillData[3] = new SkillData(setInfo.skill4, (byte)1);

        for (int i = 0; i < setInfo.Chain.Count; i++)
        {
            uint.TryParse(setInfo.Chain[i], out skillIndex);
            myData.SkillData[4 + i] = new SkillData(skillIndex, (byte)1);
        }

        otherPcSyncData.playerSyncDatas.Add(myData);

        return(otherPcSyncData);
    }
コード例 #7
0
    public PlayerUnitData MakeEnemySyncData(ulong uuID, string nick, uint charIdx, uint level, uint vipLv, int att, uint costumeIdx
                                            , bool isHideCostume, List <int> equipIdxList, List <_PartnerData> parList, uint prefix, uint suffix, uint skillSetId)
    {
        PlayerUnitData   enemyData = new PlayerUnitData();
        List <_ItemData> equipList = new List <_ItemData>();
        uint             HELMETID  = 0;
        uint             CLOTHID   = 0;
        uint             WEAPONID  = 0;

        for (int i = 0; i < equipIdxList.Count; i++)
        {
            Item.EquipmentInfo equipInfo = _LowDataMgr.instance.GetLowDataEquipItemInfo((uint)equipIdxList[i]);
            if (equipInfo == null)
            {
                continue;
            }

            switch ((ePartType)equipInfo.Type)
            {
            case ePartType.CLOTH:
                CLOTHID = equipInfo.Id;
                break;

            case ePartType.HELMET:
                HELMETID = equipInfo.Id;
                break;

            case ePartType.WEAPON:
                WEAPONID = equipInfo.Id;
                break;
            }

            equipList.Add(new _ItemData((ulong)equipIdxList[i], (uint)equipIdxList[i], 0, equipInfo.Grade, 0, 0));
        }

        ushort[] skillLevel = new ushort[] {        //스킬의 레벨을 현재는 알 수 없다. 1로 강제지정한다.
            1, 1, 1, 1, 1
        };
        Dictionary <AbilityType, float> playerStats = CalcPlayerStats(charIdx, level, equipList, new _CostumeData((ulong)costumeIdx, (uint)costumeIdx, 1, 0, skillLevel, true, true));

        if (isHideCostume)
        {
        }
        else
        {
        }

        //Item.CostumeInfo costumeData = _LowDataMgr.instance.GetLowDataCostumeInfo(costumeIdx);
        //서버에서 정상적인 데이터 오기전까지는 일렇게.
        if (skillSetId <= 0)
        {
            switch (charIdx)
            {
            case 11000:
                skillSetId = 100;
                break;

            case 12000:
                skillSetId = 200;
                break;

            case 13000:
                skillSetId = 300;
                break;
            }
        }
        enemyData.Init(0,
                       (int)eTeamType.Team2,
                       nick,
                       uuID,
                       uuID,
                       charIdx,
                       HELMETID,
                       costumeIdx,
                       CLOTHID,
                       WEAPONID,
                       skillSetId,
                       isHideCostume,
                       level,
                       prefix,
                       suffix,
                       playerStats);

        uint skillIndex = 0;

        SkillTables.SkillSetInfo setInfo = _LowDataMgr.instance.GetLowDataSkillSet(skillSetId);
        for (int i = 0; i < setInfo.skill0.Count; i++)
        {
            uint.TryParse(setInfo.skill0[i], out skillIndex);
            enemyData.NormalAttackData[i] = new SkillData(skillIndex, (byte)skillLevel[0]);
        }

        enemyData.SkillData[0] = new SkillData(setInfo.skill1, (byte)1);
        enemyData.SkillData[1] = new SkillData(setInfo.skill2, (byte)1);
        enemyData.SkillData[2] = new SkillData(setInfo.skill3, (byte)1);
        enemyData.SkillData[3] = new SkillData(setInfo.skill4, (byte)1);

        for (int i = 0; i < setInfo.Chain.Count; i++)
        {
            uint.TryParse(setInfo.Chain[i], out skillIndex);
            enemyData.SkillData[4 + i] = new SkillData(skillIndex, (byte)skillLevel[1]);
        }
        _playerSyncData.playerSyncDatas.Add(enemyData);

        for (int i = 0; i < parList.Count; i++)
        {
            _PartnerData partner = parList[i];

            if (partner != null)
            {
                Partner.PartnerDataInfo partnerInfo = partner.GetLowData();
                if (partnerInfo == null)                //테이블 변경으로 서버에서 가지고 있는 데이터와 다를 수 있다.
                {
                    Debug.LogWarning("not found partner lowData error " + partner._partnerDataIndex);
                    continue;
                }

                Dictionary <AbilityType, float> partnerStats = CalcPartnerStats(partner._NowLevel, partnerInfo, partnerInfo.Quality /*, partner._MinorGrade, partner._Enchant*/);

                PlayerUnitData partnerData = new PlayerUnitData();
                partnerData.Init((byte)(i + 1),
                                 (byte)eTeamType.Team2,
                                 partner.GetLocName(),                //"Partner0",
                                 2 + (ulong)i,
                                 2 + (ulong)i,
                                 partner._partnerDataIndex,
                                 partner._NowLevel,
                                 partnerStats);

                partnerData.NormalAttackData[0] = new SkillData(partnerInfo.skill0, 1);
                partnerData.SkillData[0]        = new SkillData(partnerInfo.skill1, 1);
                partnerData.SkillData[1]        = new SkillData(partnerInfo.skill2, 1);
                partnerData.SkillData[2]        = new SkillData(partnerInfo.skill3, 1);
                partnerData.SkillData[3]        = new SkillData(partnerInfo.skill4, 1);

                //파트너 버프 삭제
                //if (partner.GetBuffSkillToSlot(0) != null)
                //	if (partner.GetBuffSkillToSlot(0)._skillIndex != 0)
                //		partnerData.PassiveBuff[0] = new SkillData(partner.GetBuffSkillToSlot(0)._skillIndex, (byte)partner.GetBuffSkillToSlot(0)._skillLevel);

                //if (partner.GetBuffSkillToSlot(1) != null)
                //	if (partner.GetBuffSkillToSlot(1)._skillIndex != 0)
                //		partnerData.PassiveBuff[1] = new SkillData(partner.GetBuffSkillToSlot(1)._skillIndex, (byte)partner.GetBuffSkillToSlot(1)._skillLevel);

                //if (partner.GetBuffSkillToSlot(2) != null)
                //	if (partner.GetBuffSkillToSlot(2)._skillIndex != 0)
                //		partnerData.PassiveBuff[2] = new SkillData(partner.GetBuffSkillToSlot(2)._skillIndex, (byte)partner.GetBuffSkillToSlot(2)._skillLevel);

                //if (partner.GetBuffSkillToSlot(3) != null)
                //	if (partner.GetBuffSkillToSlot(3)._skillIndex != 0)
                //		partnerData.PassiveBuff[3] = new SkillData(partner.GetBuffSkillToSlot(3)._skillIndex, (byte)partner.GetBuffSkillToSlot(3)._skillLevel);

                _playerSyncData.partnerSyncDatas.Add(partnerData);
            }
        }

        return(enemyData);
    }
コード例 #8
0
    public void MakePlayerFreeFightSyncData(PMsgBattleMapEnterMapS netData)
    {
        //내 플레이어용 싱크데이터
        _playerSyncData = null;
        _playerSyncData = new _PlayerSyncData();

        PlayerUnitData myData = new PlayerUnitData();

        _playerSyncData.Init();

        Dictionary <AbilityType, float> playerStats = CalcPlayerStats();

        playerStats[AbilityType.HP]         = netData.UnHp;
        playerStats[AbilityType.SUPERARMOR] = netData.UnMaxSuperArmor;

        uint HELMETID = 0;
        uint CLOTHID  = 0;
        uint WEAPONID = 0;

        Item.EquipmentInfo tempInfo = GetUserInfo().GetEquipPartsLowData(ePartType.HELMET);
        if (tempInfo == null)
        {
            HELMETID = 0;
        }
        else
        {
            HELMETID = tempInfo.Id;
        }

        tempInfo = GetUserInfo().GetEquipPartsLowData(ePartType.CLOTH);
        if (tempInfo == null)
        {
            CLOTHID = 0;
        }
        else
        {
            CLOTHID = tempInfo.Id;
        }

        tempInfo = GetUserInfo().GetEquipPartsLowData(ePartType.WEAPON);
        if (tempInfo == null)
        {
            WEAPONID = 0;
        }
        else
        {
            WEAPONID = tempInfo.Id;
        }

        //ushort[] skillLevel = null;
        //uint equipCostumeId = 0;
        //if (GetUserInfo().GetEquipCostume() == null)
        //{
        //    Newbie.NewbieInfo newbieinfo = _LowDataMgr.instance.GetNewbieCharacterData(GetUserInfo()._userCharIndex);
        //    equipCostumeId = newbieinfo.CostumIdx;

        //    skillLevel = new ushort[] {
        //        1, 1, 1, 1, 1
        //    };
        //}
        //else
        //{
        //    equipCostumeId = GetUserInfo().GetEquipCostume()._costmeDataIndex;
        //    skillLevel = GetUserInfo().GetEquipCostume()._skillLevel;
        //}

        ushort[] skillLevel     = null;
        uint     equipCostumeId = 0;

        equipCostumeId = (uint)netData.UnCostumeId;
        skillLevel     = new ushort[] { 1, 1, 1, 1, 1 };

        //Item.CostumeInfo costumeData = _LowDataMgr.instance.GetLowDataCostumeInfo(equipCostumeId);
        SkillSetData skillSetData = GetUserInfo().GetEquipSKillSet();

        myData.Init(0,
                    0,
                    Nickname,
                    NetData.instance.AccountUUID,
                    0,
                    GetUserInfo().GetCharIdx(),
                    HELMETID,
                    equipCostumeId,
                    CLOTHID,
                    WEAPONID,
                    skillSetData.SkillSetId,
                    GetUserInfo().isHideCostum,
                    GetUserInfo()._Level,
                    GetUserInfo()._LeftTitle,
                    GetUserInfo()._RightTitle,
                    playerStats);

        uint skillIndex = 0;

        SkillTables.SkillSetInfo setInfo = _LowDataMgr.instance.GetLowDataSkillSet(skillSetData.SkillSetId);
        for (int i = 0; i < setInfo.skill0.Count; i++)
        {
            uint.TryParse(setInfo.skill0[i], out skillIndex);
            myData.NormalAttackData[i] = new SkillData(skillIndex, (byte)skillLevel[0]);
        }

        myData.SkillData[0] = new SkillData(skillSetData.SkillId[0], (byte)skillSetData.SkillLevel[0]);
        myData.SkillData[1] = new SkillData(skillSetData.SkillId[1], (byte)skillSetData.SkillLevel[1]);
        myData.SkillData[2] = new SkillData(skillSetData.SkillId[2], (byte)skillSetData.SkillLevel[2]);
        myData.SkillData[3] = new SkillData(skillSetData.SkillId[3], (byte)skillSetData.SkillLevel[3]);

        for (int i = 0; i < setInfo.Chain.Count; i++)
        {
            uint.TryParse(setInfo.Chain[i], out skillIndex);
            myData.SkillData[4 + i] = new SkillData(skillIndex, (byte)skillLevel[1]);
        }
        _playerSyncData.playerSyncDatas.Add(myData);
    }
コード例 #9
0
    public void MakePlayerSyncData(bool bMakePartnerData)
    {
        //내 플레이어용 싱크데이터
        _playerSyncData = null;
        _playerSyncData = new _PlayerSyncData();

        PlayerUnitData myData = new PlayerUnitData();

        _playerSyncData.Init();

        Dictionary <AbilityType, float> playerStats = CalcPlayerStats();

        uint HELMETID = 0;
        uint CLOTHID  = 0;
        uint WEAPONID = 0;

        Item.EquipmentInfo tempInfo = GetUserInfo().GetEquipPartsLowData(ePartType.HELMET);
        if (tempInfo == null)
        {
            HELMETID = 0;
        }
        else
        {
            HELMETID = tempInfo.Id;
        }

        tempInfo = GetUserInfo().GetEquipPartsLowData(ePartType.CLOTH);
        if (tempInfo == null)
        {
            CLOTHID = 0;
        }
        else
        {
            CLOTHID = tempInfo.Id;
        }

        tempInfo = GetUserInfo().GetEquipPartsLowData(ePartType.WEAPON);
        if (tempInfo == null)
        {
            WEAPONID = 0;
        }
        else
        {
            WEAPONID = tempInfo.Id;
        }

        ushort[] skillLevel     = null;
        uint     equipCostumeId = 0;

        if (GetUserInfo().GetEquipCostume() == null)
        {
            Newbie.NewbieInfo newbieinfo = _LowDataMgr.instance.GetNewbieCharacterData(GetUserInfo()._userCharIndex);
            equipCostumeId = newbieinfo.CostumIdx;

            skillLevel = new ushort[] {
                1, 1, 1, 1, 1
            };
        }
        else
        {
            equipCostumeId = GetUserInfo().GetEquipCostume()._costmeDataIndex;
            skillLevel     = GetUserInfo().GetEquipCostume()._skillLevel;
        }

        SkillSetData skillSetData = GetUserInfo().GetEquipSKillSet();
        uint         skillSetId   = 0;

        uint[] skillIds = new uint[4];
        uint[] skillLv  = new uint[4];

        if (skillSetData == null)
        {
            switch (GetUserInfo().GetCharIdx())
            {
            case 11000:
                skillSetId = 100;
                break;

            case 12000:
                skillSetId = 200;
                break;

            case 13000:
                skillSetId = 300;
                break;
            }

            SkillTables.SkillSetInfo info = _LowDataMgr.instance.GetLowDataSkillSet(skillSetId);
            skillIds[0] = info.skill1;
            skillIds[1] = info.skill2;
            skillIds[2] = info.skill3;
            skillIds[3] = info.skill4;
            for (int i = 0; i < skillLv.Length; i++)
            {
                skillLv[i] = 1;
            }
        }
        else
        {
            skillSetId = skillSetData.SkillSetId;
            for (int i = 0; i < skillIds.Length; i++)
            {
                skillIds[i] = skillSetData.SkillId[i];
                skillLv[i]  = skillSetData.SkillLevel[i];
            }
        }

        myData.Init(0,
                    (int)eTeamType.Team1,
                    Nickname,
                    AccountUUID,
                    0,
                    GetUserInfo().GetCharIdx(),
                    HELMETID,
                    equipCostumeId,
                    CLOTHID,
                    WEAPONID,
                    skillSetId,
                    GetUserInfo().isHideCostum,
                    GetUserInfo()._Level,
                    GetUserInfo()._LeftTitle,
                    GetUserInfo()._RightTitle,
                    playerStats);

        uint skillIndex = 0;

        SkillTables.SkillSetInfo setInfo = _LowDataMgr.instance.GetLowDataSkillSet(skillSetId);
        for (int i = 0; i < setInfo.skill0.Count; i++)
        {
            uint.TryParse(setInfo.skill0[i], out skillIndex);
            myData.NormalAttackData[i] = new SkillData(skillIndex, (byte)skillLevel[0]);
        }

        myData.SkillData[0] = new SkillData(skillIds[0], (byte)skillLv[0]);
        myData.SkillData[1] = new SkillData(skillIds[1], (byte)skillLv[1]);
        myData.SkillData[2] = new SkillData(skillIds[2], (byte)skillLv[2]);
        myData.SkillData[3] = new SkillData(skillIds[3], (byte)skillLv[3]);

        for (int i = 0; i < setInfo.Chain.Count; i++)
        {
            uint.TryParse(setInfo.Chain[i], out skillIndex);
            myData.SkillData[4 + i] = new SkillData(skillIndex, (byte)skillLevel[1]);
        }

        _playerSyncData.playerSyncDatas.Add(myData);

        if (!bMakePartnerData)
        {
            return;
        }

        for (int i = 0; i < 2; i++)                                      //GetUserInfo().GetPartnerList().Count
        {
            _PartnerData partner = GetUserInfo().GetEquipPartner(i + 1); //슬롯 시작값이 1부터이다. i를 1부터 시작시키게 했다.

            if (partner != null)
            {
                Partner.PartnerDataInfo         partnerInfo  = partner.GetLowData();
                Dictionary <AbilityType, float> partnerStats = CalcPartnerStats(partner._NowLevel, partnerInfo, partnerInfo.Quality /*, partner._MinorGrade, partner._Enchant*/);

                PlayerUnitData partnerData = new PlayerUnitData();
                partnerData.Init((byte)(i + 1),
                                 (byte)eTeamType.Team1,
                                 partner.GetLocName(),                //"Partner0",
                                 2 + (ulong)i,
                                 0,
                                 partner._partnerDataIndex,
                                 partner._NowLevel,
                                 partnerStats);

                partnerData.NormalAttackData[0] = new SkillData(partnerInfo.skill0, 1);
                partnerData.SkillData[0]        = new SkillData(partnerInfo.skill1, 1);
                partnerData.SkillData[1]        = new SkillData(partnerInfo.skill2, 1);
                partnerData.SkillData[2]        = new SkillData(partnerInfo.skill3, 1);
                partnerData.SkillData[3]        = new SkillData(partnerInfo.skill4, 1);

                //파트너 버프 삭제
                //if (partner.GetBuffSkillToSlot(0) != null)
                //	if (partner.GetBuffSkillToSlot(0)._skillIndex != 0)
                //		partnerData.PassiveBuff[0] = new SkillData(partner.GetBuffSkillToSlot(0)._skillIndex, (byte)partner.GetBuffSkillToSlot(0)._skillLevel);

                //if (partner.GetBuffSkillToSlot(1) != null)
                //	if (partner.GetBuffSkillToSlot(1)._skillIndex != 0)
                //		partnerData.PassiveBuff[1] = new SkillData(partner.GetBuffSkillToSlot(1)._skillIndex, (byte)partner.GetBuffSkillToSlot(1)._skillLevel);

                //if (partner.GetBuffSkillToSlot(2) != null)
                //	if (partner.GetBuffSkillToSlot(2)._skillIndex != 0)
                //		partnerData.PassiveBuff[2] = new SkillData(partner.GetBuffSkillToSlot(2)._skillIndex, (byte)partner.GetBuffSkillToSlot(2)._skillLevel);

                //if (partner.GetBuffSkillToSlot(3) != null)
                //	if (partner.GetBuffSkillToSlot(3)._skillIndex != 0)
                //		partnerData.PassiveBuff[3] = new SkillData(partner.GetBuffSkillToSlot(3)._skillIndex, (byte)partner.GetBuffSkillToSlot(3)._skillLevel);

                _playerSyncData.partnerSyncDatas.Add(partnerData);
            }
        }
    }
コード例 #10
0
    public static GameObject PCModelLoadRimSpec(uint charIdx, uint HeadItemIdx, uint CostumeItemIdx, uint ClothItemIdx, uint WeaponItemIdx, bool HideCostume, ref GameObject[] WeaponEffect, bool isWeapon = true)
    {
        //추후 다 어셋번들에서 읽어오게 해야함
        GameObject _unit      = null;
        string     headPref   = "";
        string     weaponPref = "";
        string     clothPref  = "";

        //착용한 머리아이템의 정보
        if (HeadItemIdx == 0)
        {
            //캐릭터의 디폴트 아이템의 머리외형을 가져옴
            headPref = _LowDataMgr.instance.GetDefaultItemInfo(charIdx, ePartType.HELMET).prefab;
        }
        else
        {
            //현재 장착중인 머리 가져옴
            headPref = _LowDataMgr.instance.GetLowDataEquipItemInfo(HeadItemIdx).prefab;
        }

        if (HideCostume)
        {
            //uint aniIdx = 0;

            //착용한 옷아이템이 없을경우
            if (ClothItemIdx == 0)
            {
                //캐릭터의 디폴트 아이템의 옷외형을 가져옴
                clothPref = _LowDataMgr.instance.GetDefaultItemInfo(charIdx, ePartType.CLOTH).prefab;
            }
            else
            {
                //현재 장착중인 옷을 가져옴
                Item.EquipmentInfo cloth = _LowDataMgr.instance.GetLowDataEquipItemInfo(ClothItemIdx);
                if (cloth != null)
                {
                    clothPref = cloth.prefab;
                }
            }

            //코스튬을 숨기든 말던 애니메이션 인덱스는 코스튬의 것을 가져와야함
            //uint aniIdx = _LowDataMgr.instance.GetLowDataCostumeInfo(CostumeItemIdx).AniId;

            if (isWeapon)
            {
                //착용한 무기아이템의 정보
                if (WeaponItemIdx == 0)
                {
                    //캐릭터의 디폴트 아이템의 무기외형을 가져옴
                    weaponPref = _LowDataMgr.instance.GetDefaultItemInfo(charIdx, ePartType.WEAPON).prefab;
                }
                else
                {
                    //현재 장착중인 무기 가져옴
                    Item.EquipmentInfo weapon = _LowDataMgr.instance.GetLowDataEquipItemInfo(WeaponItemIdx);
                    if (weapon != null)
                    {
                        weaponPref = weapon.prefab;
                    }
                }
            }
        }
        else
        {
            clothPref  = _LowDataMgr.instance.GetLowDataCostumeInfo(CostumeItemIdx).Bodyprefab;
            weaponPref = isWeapon ? _LowDataMgr.instance.GetLowDataCostumeInfo(CostumeItemIdx).Weaprefab : "";
        }

        //if (Resources.Load(GetPrefabSuffix("Character/Prefab/",clothPref)) != null) //
        if (Resources.Load(string.Format("Character/Prefab/{0}_s", clothPref)) != null)
        {
            clothPref = string.Format("{0}_s", clothPref);             //GetPrefabSuffix(clothPref);
        }
        else
        {
            Debug.LogWarning(string.Format("not found {0}_s prefab", clothPref));
        }

        if (!string.IsNullOrEmpty(weaponPref))
        {
            //if (Resources.Load(GetPrefabSuffix("Character/Prefab/",weaponPref)) != null)
            if (Resources.Load(string.Format("Character/Prefab/{0}_s", weaponPref)) != null)
            {
                weaponPref = string.Format("{0}_s", weaponPref);                 //GetPrefabSuffix( weaponPref);
            }
            else
            {
                Debug.LogWarning(string.Format("not found {0}_s prefab", weaponPref));
            }
        }

        //if (headPref.Contains("face") && Resources.Load(GetPrefabSuffix("Character/Prefab/",headPref)) != null)
        if (headPref.Contains("face") && Resources.Load(string.Format("Character/Prefab/{0}_s", headPref)) != null)
        {
            headPref = string.Format("{0}_s", headPref);             //GetPrefabSuffix( headPref);
        }
        else//대가리 못찾음 기본으로 셋팅해준다
        {
            Debug.LogWarning(string.Format("not found headPrefab, headItemIdx={0}, charIdx={1}", HeadItemIdx, charIdx));
            headPref = _LowDataMgr.instance.GetDefaultItemInfo(charIdx, ePartType.HELMET).prefab;

            //if (Resources.Load(GetPrefabSuffix("Character/Prefab/",headPref)) != null)
            if (Resources.Load(string.Format("Character/Prefab/{0}_s", headPref)) != null)
            {
                headPref = string.Format("{0}_s", headPref);                 //GetPrefabSuffix( headPref);
            }
        }

        //_unit = HideCostume ? CreatePlayerDefaultModel(clothPref, weaponPref, headPref) : CreatePlayerDefaultModel(clothPref, weaponPref, headPref);
        _unit = CreatePlayerDefaultModel(clothPref, weaponPref, headPref);

        if (_unit != null && WeaponEffect != null)
        {
            WeaponEffect = HideCostume ?
                           AttachWeaponEffect(_unit, false, _LowDataMgr.instance.GetDefaultItemInfo(charIdx, ePartType.WEAPON).RightWeaDummy, _LowDataMgr.instance.GetDefaultItemInfo(charIdx, ePartType.WEAPON).LeftWeaDummy)
                : AttachWeaponEffect(_unit, false, _LowDataMgr.instance.GetLowDataCostumeInfo(CostumeItemIdx).RightWeaDummy, _LowDataMgr.instance.GetLowDataCostumeInfo(CostumeItemIdx).LeftWeaDummy);
        }

        return(_unit);
    }
コード例 #11
0
    /// <summary> 아이템클릭시  </summary>
    void OnclicItemPopup(NetData.ShopItemInfo info, int price, Color nameColor)
    {
        //아이템세부정보
        //구매팝업에서는 무조건 1개로시작함

        string dec      = "";
        string itemName = "";

        if (_LowDataMgr.instance.GetLowDataEquipItemInfo(info.GoodsId) != null)//장비아이템
        {
            Item.EquipmentInfo equipLowData = _LowDataMgr.instance.GetLowDataEquipItemInfo(info.GoodsId);
            Item.ItemValueInfo valueLowData = _LowDataMgr.instance.GetLowDataItemValueInfo(equipLowData.BasicOptionIndex);

            //dec += _LowDataMgr.instance.GetStringItem(equipLowData.NameId);
            itemName = _LowDataMgr.instance.GetStringItem(equipLowData.NameId);
            //dec += "\n\n";
            dec += _LowDataMgr.instance.GetStringItem(equipLowData.DescriptionId);
            dec += "\n\n";
            dec += string.Format("{0} : {1}", uiMgr.GetAbilityLocName((AbilityType)valueLowData.OptionId)
                                 , uiMgr.GetAbilityStrValue((AbilityType)valueLowData.OptionId, valueLowData.BasicValue));;
            dec += "\n\n";
            dec += string.Format(_LowDataMgr.instance.GetStringCommon(179)
                                 , 0, 3);
        }
        else
        {
            Item.ItemInfo useLowData = _LowDataMgr.instance.GetUseItem(info.GoodsId);
            itemName = _LowDataMgr.instance.GetStringItem(useLowData.NameId);
            //dec += _LowDataMgr.instance.GetStringItem(useLowData.NameId);
            //dec += "\n\n";
            dec += _LowDataMgr.instance.GetStringItem(useLowData.DescriptionId);
        }

        GoodsName.text  = itemName;
        GoodsName.color = nameColor;
        GoodsInfo.text  = dec;

        //        시간 / 한정판매아이템일경우 초기화시간자리에 정보를 표시해줘야함
        if (CurShopType == 102 || CurShopType == 202)
        {
            //TimeItemInfo.gameObject.SetActive(true);
            ulong start = _LowDataMgr.instance.GetLowDataShopById(info.DbIndex).shopopentime;
            ulong end   = _LowDataMgr.instance.GetLowDataShopById(info.DbIndex).shopclosetime;

            //577 {0}년{0}월{1}일 // 260 {0}분
            string Start = string.Format(_LowDataMgr.instance.GetStringCommon(577),
                                         start.ToString().Substring(0, 4), start.ToString().Substring(4, 2), start.ToString().Substring(6, 2));
            Start += string.Format(_LowDataMgr.instance.GetStringCommon(260), start.ToString().Substring(8, 2));
            //Start += ":";
            //Start += start.ToString().Substring(2, 2);
            //Start += ":";
            //Start += start.ToString().Substring(4, 2);

            string End = string.Format(_LowDataMgr.instance.GetStringCommon(577),
                                       end.ToString().Substring(0, 4), end.ToString().Substring(4, 2), end.ToString().Substring(6, 2));
            End += string.Format(_LowDataMgr.instance.GetStringCommon(260), end.ToString().Substring(8, 2));


            //string End = end.ToString().Substring(0, 2);
            //End += ":";
            //End += end.ToString().Substring(2, 2);

            //End += ":";
            //End += end.ToString().Substring(4, 2);

            TimeItemInfo.text = string.Format("{0} ~ {1}", Start, End);
        }

        UseSellAmount      = 1;
        UseSellTotalAmount = (int)info.Account;

        TotalNum.text   = UseSellAmount.ToString();
        TotalPrice.text = (UseSellAmount * price).ToString();

        TotalPrice.color = ulong.Parse(TotalPrice.text) <= money ? Color.white : Color.red;  //돈이 모자르면 빨간색

        EventDelegate.Set(BtnPlus.onClick, delegate() { OnclickUseCount(1, price); });
        EventDelegate.Set(BtnMinus.onClick, delegate() { OnclickUseCount(-1, price); });

        EventDelegate.Set(BtnMax.onClick, delegate() { OnclickUseCount((int)info.Account, price); });


        EventDelegate.Set(BuyBtn.onClick, delegate()
        {
            if (UseSellAmount != 0)
            {
                string msg = string.Format(_LowDataMgr.instance.GetStringCommon(472), itemName);
                uiMgr.AddPopup(_LowDataMgr.instance.GetStringCommon(141), msg, _LowDataMgr.instance.GetStringCommon(467), _LowDataMgr.instance.GetStringCommon(76), null,
                               () =>
                {
                    SceneManager.instance.ShowNetProcess("PurchaseShopItme");
                    NetworkClient.instance.SendPMsgShopByItemC(info.Idx, CurShopType, info.GoodsId, (uint)UseSellAmount, info.DbIndex);
                });
            }
        });


        //  TotalPrice.text = ((ulong)UseSellTotalAmount * price) * ToString();//총 판매 금액
    }
コード例 #12
0
    /// <summary> 아이템 디테일 팝업 실행 함수. </summary>
    void SetDetailPopup(NetData._ItemData itemData)
    {
        CurItemData = itemData;
        Debug.Log(string.Format("Click Item UseId={0}, equipId={1}", itemData._useitemDataIndex, itemData._equipitemDataIndex));
        bool isDifferentClass = false;

        NetData._UserInfo charInven = NetData.instance.GetUserInfo();

        if (CurItemData.IsEquipItem())
        {
            LinkPopup[0].SetActive(false);
            LinkPopup[1].SetActive(false);

            int limitLv = CurItemData.GetEquipLowData().LimitLevel;
            //EquipLv.text = string.Format(_LowDataMgr.instance.GetStringCommon(952), limitLv);
            if (limitLv <= charInven._Level && !isDifferentClass)//내 직업이고 레벨이 높다면
            {
                EquipState[0].SetActive(true);
                EquipState[1].SetActive(false);
            }
            else
            {
                EquipState[0].SetActive(false);
                EquipState[1].SetActive(true);
            }

            uint strKey = 0;
            if (BasePanel is EquipmentPanel)
            {
                Item.EquipmentInfo equipLow = CurItemData.GetEquipLowData();
                if (CurItemData._enchant < equipLow.MaxEnchant)
                {
                    strKey = 31;
                }
                else if (0 < equipLow.NextPartsId)
                {
                    strKey = 32;
                }
                else//최대
                {
                    strKey = 1182;
                }
            }
            else
            {
                strKey = 106;//닫기
            }
            if (0 < strKey)
            {
                SetOnOff(MainBtn.transform, true, _LowDataMgr.instance.GetStringCommon(strKey));
            }

            //텍스트 셋팅
            int    grade = itemData.GetEquipLowData().Grade;
            string color = UIHelper.GetItemGradeColor(grade);
            ItemName.text = string.Format("{0}{1}[-] [FFE400]+{2}[-]", color, itemData.GetLocName(), itemData._enchant);
        }
        else
        {
            //EquipLv.text = "";
            EquipState[0].SetActive(false);
            EquipState[1].SetActive(false);
            LinkPopup[0].SetActive(true);
            LinkPopup[1].SetActive(false);

            SetOnOff(MainBtn.transform, true, _LowDataMgr.instance.GetStringCommon(106));
            int count = charInven.GetItemCountForItemId(CurItemData._useitemDataIndex, (byte)eItemType.USE);
            LinkItemSlot[0].SetLowDataItemSlot(CurItemData._useitemDataIndex, (uint)count);
            LinkItemSlot[0].transform.parent.FindChild("Lock").gameObject.SetActive(count <= 0);

            Transform gridTf = LinkScroll.transform.FindChild("Grid");
            List <Item.ContentsListInfo> conList = _LowDataMgr.instance.GetLowDataContentsItemList(CurItemData._useitemDataIndex);
            for (int i = 0; i < conList.Count; i++)
            {
                Item.ContentsListInfo info = conList[i];
                string contentsName        = _LowDataMgr.instance.GetStringCommon(info.ContentsName);
                if (info.ContentsParam != null && 0 < info.ContentsParam.Count)
                {
                    if (contentsName.Contains("{0}") && contentsName.Contains("{1}"))
                    {
                        contentsName = string.Format(contentsName, info.ContentsParam[0], info.ContentsParam[1]);
                    }
                    else if (contentsName.Contains("{0}"))
                    {
                        contentsName = string.Format(contentsName, info.ContentsParam[0]);
                    }
                }

                Transform tf = null;
                if (i < gridTf.childCount)
                {
                    tf = gridTf.GetChild(i);
                }
                else
                {
                    tf            = Instantiate(gridTf.GetChild(0)) as Transform;
                    tf.parent     = gridTf;
                    tf.localScale = Vector3.one;
                }

                tf.gameObject.SetActive(true);

                tf.FindChild("txt").GetComponent <UILabel>().text = contentsName;
                bool isEnter = true;
                if (CheckContentsLink(info, false))//조건 만족
                {
                    tf.FindChild("error_txt").GetComponent <UILabel>().text = "";
                }
                else
                {
                    isEnter = false;

                    string contentsError = _LowDataMgr.instance.GetStringCommon(info.ConditionName);
                    if (info.ConditionParam != null && 0 < info.ConditionParam.Count)
                    {
                        if (contentsError.Contains("{0}") && contentsError.Contains("{1}"))
                        {
                            contentsError = string.Format(contentsError, info.ConditionParam[0], info.ConditionParam[1]);
                        }
                        else if (contentsError.Contains("{0}"))
                        {
                            contentsError = string.Format(contentsError, info.ConditionParam[0]);
                        }
                    }

                    tf.FindChild("error_txt").GetComponent <UILabel>().text = contentsError;
                }

                EventDelegate.Set(tf.FindChild("Btn").GetComponent <UIEventTrigger>().onClick, () => { OnClickContentsLink(info); });
                if (info.ContentsLinkType == 1)//재료조합
                {
                    tf.FindChild("Btn/On/label").GetComponent <UILabel>().text  = _LowDataMgr.instance.GetStringCommon(39);
                    tf.FindChild("Btn/Off/label").GetComponent <UILabel>().text = _LowDataMgr.instance.GetStringCommon(39);
                }
                else if (info.ContentsLinkType == 2)//바로가기(던전)
                {
                    tf.FindChild("Btn/On/label").GetComponent <UILabel>().text  = _LowDataMgr.instance.GetStringCommon(249);
                    tf.FindChild("Btn/Off/label").GetComponent <UILabel>().text = _LowDataMgr.instance.GetStringCommon(249);
                }

                tf.FindChild("Btn/On").gameObject.SetActive(isEnter);
                tf.FindChild("Btn/Off").gameObject.SetActive(!isEnter);
            }

            gridTf.GetComponent <UIGrid>().repositionNow = true;
            for (int j = conList.Count; j < gridTf.childCount; j++)
            {
                gridTf.GetChild(j).gameObject.SetActive(false);
            }

            if (conList.Count < 4)
            {
                LinkScroll.enabled = false;
            }
            else
            {
                LinkScroll.enabled = true;
            }

            Item.ItemInfo data  = itemData.GetUseLowData();
            string        color = UIHelper.GetItemGradeColor(data == null ? 0 : (int)data.Grade);
            ItemName.text = string.Format("{0}{1}[-] [FFE400][-]", color, itemData.GetLocName());
        }

        //아이템 셋팅
        ItemSlot.SetInvenItemSlot(itemData, null, 0);

        //아이템의 옵션들 셋팅
        byte optionCount = 0;

        Desc.transform.localPosition = SetAbility(itemData, ref optionCount); //어빌리티
        SetDesc(itemData, ref optionCount);                                   //아이템 설명 표현

        OptionScrollView.ResetPosition();
        if (optionCount <= 1)//스크롤 되면 안됨.
        {
            AbilityTf.parent.collider.enabled = false;
        }
        else
        {
            AbilityTf.parent.collider.enabled = true;
        }
    }
コード例 #13
0
    public IEnumerator TownUserEnter(PMsgMapRoleInfoS anotherUserInfo)
    {
        //이미 있는경우는 추가하지 않는다.
        TownUnit unit = null;

        if (townUnitList.TryGetValue(anotherUserInfo.UllRoleId, out unit))
        {
            uint head = 0, cloth = 0, weapon = 0;
            int  equipCount = anotherUserInfo.UnEquipmentId.Count;
            for (int i = 0; i < equipCount; i++)
            {
                int equipId = anotherUserInfo.UnEquipmentId[i];
                if (equipId <= 0)
                {
                    continue;
                }

                Item.EquipmentInfo equipInfo = _LowDataMgr.instance.GetLowDataEquipItemInfo((uint)equipId);
                if (equipInfo == null)
                {
                    Debug.LogError(string.Format("friend equip item not found lowdataID={0} error", equipId));
                    continue;
                }

                if (equipInfo.UseParts == (byte)ePartType.CLOTH)
                {
                    cloth = (uint)equipId;
                }
                //else if (equipInfo.UseParts == (byte)ePartType.HELMET)
                //head = (uint)equipId;
                else if (equipInfo.UseParts == (byte)ePartType.WEAPON)
                {
                    weapon = (uint)equipId;
                }
            }

            unit.ChangeSkin(anotherUserInfo.UnCostumeShowFlag == (int)COSTUME_FLAG_TYPE.COSTUME_FLAG_HIDE, (uint)anotherUserInfo.UnCostumeId, head, cloth, weapon);
            unit.ChangeTitle(anotherUserInfo.UnTitlePrefix, anotherUserInfo.UnTitleSuffix);

            /*
             * UIBasePanel readyPopup = UIMgr.GetUIBasePanel("UIPopup/ReadyPopup");
             * if (readyPopup != null)
             * {
             *  if ((readyPopup as ReadyPopup).IsRoom)
             *  {
             *      (readyPopup as ReadyPopup).OnChangeUserInfo(anotherUserInfo.UllRoleId);
             *  }
             * }
             */
            yield break;
        }

        if (NetData.instance.GetUserInfo().GetCharUUID() == (ulong)anotherUserInfo.UllRoleId)
        {
            yield break;
        }

        NetData.RecommandFriendData friend = new NetData.RecommandFriendData();

        friend.c_usn         = (ulong)anotherUserInfo.UllRoleId;
        friend.character_id  = (uint)anotherUserInfo.UnType;
        friend.nickname      = anotherUserInfo.SzName;
        friend.level         = (uint)anotherUserInfo.UnLevel;
        friend.costume_id    = (uint)anotherUserInfo.UnCostumeId;
        friend.isHideCostume = (int)COSTUME_FLAG_TYPE.COSTUME_FLAG_HIDE == anotherUserInfo.UnCostumeShowFlag;
        friend.Prefix        = anotherUserInfo.UnTitlePrefix;
        friend.Sufffix       = anotherUserInfo.UnTitleSuffix;

        if (friend.character_id < 10000)
        {
            friend.character_id = 12000;
        }

        if (friend.costume_id <= 0)
        {
            Debug.LogError(string.Format("RoleID: {0}, costume idx = {1} error charIdx={2}", anotherUserInfo.UllRoleId, friend.costume_id, friend.character_id));

            if (friend.character_id == 11000)
            {
                friend.costume_id = 100;
            }
            else if (friend.character_id == 12000)
            {
                friend.costume_id = 110;
            }
            else if (friend.character_id == 13000)
            {
                friend.costume_id = 120;
            }
        }

        int count = anotherUserInfo.UnEquipmentId.Count;

        for (int i = 0; i < count; i++)
        {
            int equipId = anotherUserInfo.UnEquipmentId[i];
            if (equipId <= 0)
            {
                continue;
            }

            Item.EquipmentInfo equipInfo = _LowDataMgr.instance.GetLowDataEquipItemInfo((uint)equipId);
            if (equipInfo == null)
            {
                Debug.LogError(string.Format("friend equip item not found lowdataID={0} error", equipId));
                continue;
            }

            if (equipInfo.UseParts == (byte)ePartType.CLOTH)
            {
                friend.EquipClothItemIdx = (uint)equipId;
            }
            //else if (equipInfo.UseParts == (byte)ePartType.HELMET)
            //friend.EquipHeadItemIdx = (uint)equipId;
            else if (equipInfo.UseParts == (byte)ePartType.WEAPON)
            {
                friend.EquipWeaponItemIdx = (uint)equipId;
            }
        }

        /*
         * if (friend.character_id == 11000)
         * {
         *  friend.costume_id = (uint)100;
         * }
         * else if (friend.character_id == 12000)
         * {
         *  friend.costume_id = (uint)110;
         * }
         * else if (friend.character_id == 13000)
         * {
         *  friend.costume_id = (uint)120;
         * }
         * else
         * {
         *  Debug.LogError(string.Format("error not found character id {0}, is setting default id:{1}", friend.character_id, 11000));
         *  friend.character_id = 11000;
         *  friend.costume_id = (uint)100;
         * }
         */

        object[] initialData = new object[4] {
            0, 0, (int)UnitType.TownNpc, friend
        };

        //TownUnit tu = TownUnit.CreateTownUnit(anotherUserInfo.UnPosX, anotherUserInfo.UnPosY, initialData);
        TownUnit tu = null;

        yield return(StartCoroutine(TownUnit.CreateTownUnitAsync(anotherUserInfo.UnPosX, anotherUserInfo.UnPosY, (retval) => { tu = retval; }, initialData)));

        tu.ChangeState(UnitState.Idle);

        if (!townUnitList.ContainsKey(anotherUserInfo.UllRoleId))
        {
            townUnitList.Add(anotherUserInfo.UllRoleId, tu);
        }
        else
        {
            Debug.LogError(string.Format("is already key error key={0}, name={1}, isMyChar={2}"
                                         , anotherUserInfo.UllRoleId, anotherUserInfo.SzName, ((ulong)anotherUserInfo.UllRoleId) == NetData.instance.GetUserInfo()._charUUID));
        }

        UIBasePanel basePanel = UIMgr.GetTownBasePanel();

        if (basePanel != null)
        {
            (basePanel as TownPanel).CreateHeadObjet(tu.gameObject, friend.nickname, friend.Prefix, friend.Sufffix, false);

            //string path = string.Format("Effect/_UI/_INGAME/{0}", name);
            CreateAccessEff(tu.gameObject);
        }
        else
        {
            TownNickList.Add(new TownNickData(tu.gameObject, friend.nickname, friend.Prefix, friend.Sufffix));
        }
    }
コード例 #14
0
    public override void Init()
    {
        base.Init();

        //일단 아이템 셋팅
        List <Welfare.EventCheckInfo> list = new List <Welfare.EventCheckInfo>();

        list = _LowDataMgr.instance.GetLowDataEventCheck(3);

        for (int i = 0; i < SlotRoot.childCount; i++)
        {
            GameObject go       = SlotRoot.GetChild(i).gameObject;
            UILabel    itemName = go.transform.FindChild("Txt_gold").GetComponent <UILabel>();               //수량
            UISprite   itemImg  = go.transform.FindChild("get").FindChild("Icon").GetComponent <UISprite>(); //아이템 이미지

            List <GatchaReward.FixedRewardInfo> fixList = _LowDataMgr.instance.GetFixedRewardItemGroupList(list[i].RewardId);

            Item.EquipmentInfo eLowData = _LowDataMgr.instance.GetLowDataEquipItemInfo(fixList[0].ItemId);
            bool isEquip = false;
            if (eLowData != null)//장비아이템이 드랍아이템 대표로 등록되어 있음
            {
                if (itemImg.atlas != EquipAtlas)
                {
                    itemImg.atlas = EquipAtlas;
                }

                itemImg.spriteName = _LowDataMgr.instance.GetLowDataIcon(eLowData.Icon);
                itemName.text      = string.Format("{0} x{1}", _LowDataMgr.instance.GetStringItem(eLowData.NameId), fixList[0].ItemCount);
                isEquip            = true;
            }
            else//소모아이템이 드랍아이템 대표로 등록되어 있음
            {
                Item.ItemInfo uLowData = _LowDataMgr.instance.GetUseItem(fixList[0].ItemId);
                if (uLowData == null)
                {
                    //Debug.LogError("item id error" + list[0].ItemId);
                    //따로체크
                    if (itemImg.atlas != ItemAtlas)
                    {
                        itemImg.atlas = ItemAtlas;
                    }
                    isEquip = false;

                    if (list[0].Type == 1)//골드
                    {
                        itemImg.spriteName = "Icon_10000";
                        itemName.text      = string.Format("{0} x{1}", _LowDataMgr.instance.GetStringCommon(4), fixList[0].ItemCount);
                    }
                    if (list[0].Type == 2)//원보
                    {
                        itemImg.spriteName = "Icon_10001";
                        itemName.text      = string.Format("{0} x{1}", _LowDataMgr.instance.GetStringCommon(3), fixList[0].ItemCount);
                    }
                    if (list[0].Type == 10)  //파트너
                    {
                        if (_LowDataMgr.instance.IsGetRewardType(10, fixList[0].ItemId))
                        {
                            if (itemImg.atlas != Face)
                            {
                                itemImg.atlas = Face;
                            }

                            itemImg.spriteName = _LowDataMgr.instance.GetPartnerInfo(fixList[0].ItemId).PortraitId;
                            itemName.text      = string.Format("{0} x{1}", _LowDataMgr.instance.GetStringUnit(_LowDataMgr.instance.GetPartnerInfo(fixList[0].ItemId).NameId), fixList[0].ItemCount);
                            isEquip            = false;
                        }
                    }
                    //continue;
                }
                else
                {
                    if (itemImg.atlas != ItemAtlas)
                    {
                        itemImg.atlas = ItemAtlas;
                    }

                    itemImg.spriteName = _LowDataMgr.instance.GetLowDataIcon(uLowData.Icon);
                    itemName.text      = string.Format("{0} x{1}", _LowDataMgr.instance.GetStringItem(uLowData.NameId), fixList[0].ItemCount);

                    isEquip = false;
                }
            }
        }
    }
コード例 #15
0
    IEnumerator CreateEquipment()
    {
        uint charId = NetData.instance.GetUserInfo().GetCharIdx();

        uint[] equipId;
        if (charId == 11000)
        {
            equipId = new uint[] { 410002, 410012, 410022, 410032, 410042, 410102, 410112, 410122, 410132, 410142,
                                   410202, 410212, 410222, 410232, 410242, 410302, 410312, 410322, 410332, 410342, 410402, 410412,
                                   410422, 410432, 410442, 410502, 410512, 410522, 410532, 410542, 410602, 410612, 410622, 410632,
                                   410642, 410702, 410712, 410722, 410732, 410742, 410652, 410752, 410852, 510001 }
        }
        ;
        else if (charId == 12000)
        {
            equipId = new uint[] {
                420002, 420012, 420022, 420032, 420042, 420102, 420112, 420122, 420132, 420142, 420202, 420212, 420222, 420232, 420242, 420302,
                420312, 420322, 420332, 420342, 420402, 420412, 420422, 420432, 420442, 420502, 420512, 420522, 420532, 420542,
                420602, 420612, 420622, 420632, 420642, 420702, 420712, 420722, 420732, 420742, 420652, 420752, 420852, 520001
            }
        }
        ;
        else
        {
            equipId = new uint[] {
                430002, 430012, 430022, 430032, 430042, 430102, 430112, 430122, 430132, 430142,
                430202, 430212, 430222, 430232, 430242, 430302, 430312, 430322, 430332, 430342, 430402, 430412, 430422, 430432, 430442, 430502, 430512,
                430522, 430532, 430542, 430602, 430612, 430622, 430632, 430642, 430702, 430712, 430722, 430732, 430742, 430652, 430752, 430852, 530001
            }
        };

        int         count  = 0;
        _LowDataMgr lowMgr = _LowDataMgr.instance;

        while (count < equipId.Length)
        {
            Item.EquipmentInfo item = lowMgr.GetLowDataEquipItemInfo(equipId[count]);
            if (item == null)
            {
                break;
            }

            NetworkClient.instance.SendPMsgTalkCS((int)Sw.TALK_CHANNEL_TYPE.TALK_CHANNEL_PRIVATE, 0, "", string.Format("/aq {0} 1", equipId[count++]), 1);

            yield return(new WaitForSeconds(0.1f));
        }

        UIMgr.instance.AddPopup("알림", "의상 생성 치트키 끝", "확인", null, null, delegate() {
            base.Close();
        });
    }

    void CreateMaterials(string type, int amount)
    {
        int[] ids = null;
        if (type.Equals("asd"))
        {
            ids = new int[] {
                554009, 554010, 554011, 554012, 554013, 554014,
                560450, 560451, 560452, 560453, 560454, 560455, 560456,
                560461, 560462, 560463, 560464, 560465, 560466, 560467, 560468, 560469,
                560470, 560471, 560472, 560473, 560474, 560475, 560476, 560477, 560478, 560479, 560480,
                560500, 560510, 560511, 560512, 560513,
                560530, 560531, 560532, 560533,
                560550, 560551, 560558, 560559, 560560, 567700, 567701, 599008
            };
        }
        else if (type.Equals("shard"))
        {
            List <int> idList = new List <int>();
            List <Partner.PartnerDataInfo> parList = _LowDataMgr.instance.GetPartnerDataToList();
            for (int i = 0; i < parList.Count; i++)
            {
                if (idList.Contains((int)parList[i].ShardIdx))
                {
                    continue;
                }

                idList.Add((int)parList[i].ShardIdx);
            }

            ids = idList.ToArray();
        }
        else if (type.Equals("costume"))
        {
            uint charIdx = NetData.instance.GetUserInfo()._userCharIndex;
            if (charIdx.Equals(11000))
            {
                //권사 코스튬 조각
                ids = new int[] {
                    560100,
                    560101,
                    560102
                };
            }
            else if (charIdx.Equals(12000))
            {
                //명장 코스튬 조각
                ids = new int[] {
                    560200,
                    560201,
                    560202
                };
            }
            else if (charIdx.Equals(13000))
            {
                //협녀 코스튬 조각
                ids = new int[] {
                    560300,
                    560301,
                    560302
                };
            }
        }

        for (int i = 0; i < ids.Length; i++)
        {
            string key = string.Format("/ai {0} {1}", ids[i], amount);
            NetworkClient.instance.SendPMsgTalkCS((int)Sw.TALK_CHANNEL_TYPE.TALK_CHANNEL_PRIVATE, 0, "", key, 1);
        }
    }

    void OnClickSend()
    {
        string str = Input.value;

        if (string.IsNullOrEmpty(str))
        {
            return;
        }

        if (str.Contains(" ") && !str.Contains("game"))//&& (str.Contains(" ") || str.CompareTo("s") == 0 ) )
        {
            string[] value = str.Split(' ');
            if (value.Length <= 0)
            {
                return;
            }
            switch (value[0])
            {
            case "ag":
            case "ac":
            case "af":
            case "ah":
            case "aco":
            case "ar":
            case "alk":
            case "ae":
            {
                uint   amount = uint.Parse(value[1]);
                string send   = string.Format("/{0} {1}", value[0], amount);
                NetworkClient.instance.SendPMsgTalkCS((int)Sw.TALK_CHANNEL_TYPE.TALK_CHANNEL_PRIVATE, 0, "", send, 1);
            }
            break;

            case "ai":
            case "aq":
            case "act":
            {
                uint   id     = uint.Parse(value[1]);
                uint   amount = uint.Parse(value[2]);
                string send   = string.Format("/{0} {1} {2}", value[0], id, amount);
                NetworkClient.instance.SendPMsgTalkCS((int)Sw.TALK_CHANNEL_TYPE.TALK_CHANNEL_PRIVATE, 0, "", send, 1);
            }
            break;

            case "sp":
            {
                uint   amount = uint.Parse(value[1]);
                string send   = string.Format("/ai 599007 {0}", amount);
                NetworkClient.instance.SendPMsgTalkCS((int)Sw.TALK_CHANNEL_TYPE.TALK_CHANNEL_PRIVATE, 0, "", send, 1);
            }
            break;

            case "mal":
            {
                uint   amount = uint.Parse(value[1]);
                string send   = string.Format("/{0} {1}", value[0], amount);
                NetworkClient.instance.SendPMsgTalkCS((int)Sw.TALK_CHANNEL_TYPE.TALK_CHANNEL_PRIVATE, 0, "", send, 1);
            }
            break;

            case "s":
            {
                //uint amount = uint.Parse(value[1]);
                //string send = string.Format("/{0} {1}", value[0], amount);
                //NetworkClient.instance.SendPMsgTalkCS((int)Sw.TALK_CHANNEL_TYPE.TALK_CHANNEL_PRIVATE, 0, "", send, 1);
                NetworkClient.instance.SendPMsgBuyPowerC();
            }
            break;

            case "ku":
            {
                long   amount = long.Parse(value[1]);
                string send   = string.Format("/{0} {1}", value[0], amount);
                NetworkClient.instance.SendPMsgTalkCS((int)Sw.TALK_CHANNEL_TYPE.TALK_CHANNEL_PRIVATE, 0, "", send, 1);
            }
            break;

            case "asd":
            case "shard":
            case "costume":
            {
                int amount = int.Parse(value[1]);
                CreateMaterials(value[0], amount);
            }
            break;

            case "preview":
            {
                uint amount = uint.Parse(value[1]);
                SceneManager.instance.SetNoticePanel(NoticeType.GetMailItem, amount);
            }
            break;

            case "opentask":
            {
                uint   amount = uint.Parse(value[1]);
                string send   = string.Format("/{0} {1}", value[0], amount);
                NetworkClient.instance.SendPMsgTalkCS((int)Sw.TALK_CHANNEL_TYPE.TALK_CHANNEL_PRIVATE, 0, "", send, 1);
            }
            break;

            case "setskill":
                uint skillId = uint.Parse(value[1]);

                NetData.instance.GetUserInfo().GetEquipSKillSet().IsEquip = false;
                bool isSet = false;
                List <NetData.SkillSetData> skillData = NetData.instance.GetUserInfo()._SKillSetList;
                for (int i = 0; i < skillData.Count; i++)
                {
                    if (!skillData[i].SkillSetId.Equals(skillId))
                    {
                        continue;
                    }

                    isSet = true;
                    skillData[i].IsEquip = true;
                    break;
                }

                if (!isSet)
                {
                    SkillTables.SkillSetInfo info = _LowDataMgr.instance.GetLowDataSkillSet(skillId);
                    skillData.Add(new NetData.SkillSetData(true, new uint[] { 1, 1, 1, 1 }, new uint[] { info.skill1, info.skill2, info.skill3, info.skill4 }, skillId, 0));
                }
                break;
            }
        }
        else
        {
            if (str.Equals("allclear"))
            {
                StartCoroutine("_ClearAllStage");
                return;
            }
            if (str.Equals("questclear"))
            {
                StartCoroutine("QuestClear");
                return;
            }
            else if (str.Equals("allequip"))
            {
                StartCoroutine("CreateEquipment");
                return;
            }
            else if (str.Equals("cg"))
            {
                NetworkClient.instance.SendPMsgTalkCS((int)Sw.TALK_CHANNEL_TYPE.TALK_CHANNEL_PRIVATE, 0, "", "/cg", 1);

                string loginType  = PlayerPrefs.GetString("logintype", "none");
                string user_id    = PlayerPrefs.GetString("user_id", "none");
                string user_token = PlayerPrefs.GetString("user_token", "none");

                if (loginType.Equals("google"))
                {
                    PlayerPrefs.DeleteKey("logintype");
                    PlayerPrefs.DeleteKey("user_id");
                    PlayerPrefs.DeleteKey("user_token");
                    NetData.instance._LoginType = eLoginType.GUEST;
                }

                return;
            }
            else if (str.Equals("cfb"))
            {
                NetworkClient.instance.SendPMsgTalkCS((int)Sw.TALK_CHANNEL_TYPE.TALK_CHANNEL_PRIVATE, 0, "", "/cfb", 1);

                string loginType  = PlayerPrefs.GetString("logintype", "none");
                string user_id    = PlayerPrefs.GetString("user_id", "none");
                string user_token = PlayerPrefs.GetString("user_token", "none");

                if (loginType.Equals("facebook"))
                {
                    PlayerPrefs.DeleteKey("logintype");
                    PlayerPrefs.DeleteKey("user_id");
                    PlayerPrefs.DeleteKey("user_token");
                    NetData.instance._LoginType = eLoginType.GUEST;
                }

                return;
            }
            else if (str.Contains("game"))
            {
                string[] split = str.Split(' ');
                if (split[1].Contains("single"))
                {
                    string[] split2   = split[1].Split('_');
                    uint     stageNum = 0;
                    if (uint.TryParse(split2[1], out stageNum))
                    {
                        SceneManager.instance.ShowLoadingTipPanel(true, GAME_MODE.SINGLE, () =>
                        {
                            //이상태에서의 데이터를 저장
                            NetData.instance.MakePlayerSyncData(true);

                            SingleGameState.lastSelectStageId = stageNum;
                            SingleGameState.verifyToken       = 1023;
                            SingleGameState.IsTest            = true;
                            SingleGameState.StageQuestList    = new System.Collections.Generic.List <NetData.StageClearData>();
                            SingleGameState.CurStageName      = split[1];

                            SceneManager.instance.ActionEvent(_ACTION.PLAY_SINGLE);

                            base.GotoInGame();
                        });
                    }
                }
                else if (split[1].Contains("devildom_tower"))
                {
                    uint stageNum = 0;
                    List <DungeonTable.TowerInfo> list = _LowDataMgr.instance.GetLowDataTowerList();
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (!list[i].mapName.Equals(split[1]))
                        {
                            continue;
                        }

                        stageNum = list[i].StageIndex;
                        break;
                    }

                    if (0 < stageNum)
                    {
                        SceneManager.instance.ShowLoadingTipPanel(true, GAME_MODE.TOWER, () =>
                        {
                            //이상태에서의 데이터를 저장
                            NetData.instance.MakePlayerSyncData(true);

                            TowerGameState.lastSelectStageId = stageNum;
                            TowerGameState.IsTest            = true;

                            SceneManager.instance.ActionEvent(_ACTION.PLAY_TOWER);
                            base.GotoInGame();
                        });
                    }
                }
                else if (split[1].Contains("Raid_Dungeon"))
                {
                    uint stageNum = 0;
                    List <DungeonTable.SingleBossRaidInfo> list = _LowDataMgr.instance.GetLowDataBossRaidList();
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (!list[i].stageName.Equals(split[1]))
                        {
                            continue;
                        }

                        stageNum = list[i].raidId;
                        break;
                    }

                    if (0 < stageNum)
                    {
                        SceneManager.instance.ShowLoadingTipPanel(true, GAME_MODE.RAID, () =>
                        {
                            //이상태에서의 데이터를 저장
                            NetData.instance.MakePlayerSyncData(true);

                            RaidGameState.lastSelectStageId = stageNum;
                            RaidGameState.IsTest            = true;

                            SceneManager.instance.ActionEvent(_ACTION.PLAY_RAID);

                            base.GotoInGame();
                        });
                    }
                }
                else if (split[1].Contains("tower"))
                {
                    string[] split2   = split[1].Split('_');
                    uint     stageNum = 0;
                    if (uint.TryParse(split2[1], out stageNum))
                    {
                        SceneManager.instance.ShowLoadingTipPanel(true, GAME_MODE.TOWER, () =>
                        {
                            //이상태에서의 데이터를 저장
                            NetData.instance.MakePlayerSyncData(true);

                            TowerGameState.lastSelectStageId = stageNum;
                            TowerGameState.IsTest            = true;

                            SceneManager.instance.ActionEvent(_ACTION.PLAY_TOWER);

                            base.GotoInGame();
                        });
                    }
                }
                else if (split[1].Contains("raid"))
                {
                    string[] split2   = split[1].Split('_');
                    uint     stageNum = 0;
                    if (uint.TryParse(split2[1], out stageNum))
                    {
                        SceneManager.instance.ShowLoadingTipPanel(true, GAME_MODE.RAID, () =>
                        {
                            //이상태에서의 데이터를 저장
                            NetData.instance.MakePlayerSyncData(true);

                            RaidGameState.lastSelectStageId = stageNum;
                            RaidGameState.IsTest            = true;

                            SceneManager.instance.ActionEvent(_ACTION.PLAY_RAID);

                            base.GotoInGame();
                        });
                    }
                }
            }
            else if (str.Equals("q"))
            {
                if (!TownState.TownActive)
                {
                    InGameHUDPanel.ZeroDamagePlay_01 = !InGameHUDPanel.ZeroDamagePlay_01;
                }
            }
            else if (str.Equals("qq"))
            {
                if (!TownState.TownActive)
                {
                    InGameHUDPanel.ZeroDamagePlay = !InGameHUDPanel.ZeroDamagePlay;
                }
            }
            else if (str.Equals("cooltime"))
            {
                if (!TownState.TownActive)
                {
                    InGameHUDPanel.ZeroSkillCoolTime = !InGameHUDPanel.ZeroSkillCoolTime;
                }
            }
            else if (str.Equals("tutoreset"))
            {
                string key = string.Format("TutorialData_{0}.json", NetData.instance.GetUserInfo().GetCharUUID());
                if (PlayerPrefs.HasKey(key))
                {
                    PlayerPrefs.DeleteKey(key);
                }
            }
            else
            {
                SceneManager.instance.ShowLoadingTipPanel(true, GAME_MODE.NONE, () =>
                {
                    //이상태에서의 데이터를 저장
                    NetData.instance.MakePlayerSyncData(true);

                    TutorialGameState.StageName         = str;
                    TutorialGameState.lastSelectStageId = 1;
                    TutorialGameState.verifyToken       = 1023;

                    SceneManager.instance.ActionEvent(_ACTION.PLAY_TUTORIAL);

                    base.GotoInGame();
                });
            }

            base.Close();
        }
    }
コード例 #16
0
    void OnClickUpBtn(int viewType)
    {
        List <GatchaReward.RewardInfo> list = null;

        switch ((eRateViewType)viewType)
        {
        case eRateViewType.all:    // 12 , 13, 11, 8, 10, 14
            list = _LowDataMgr.instance.GetGachaRewardItemLsit(12, CurRateTabIdx, true);
            break;

        case eRateViewType.equip:    //12
            list = _LowDataMgr.instance.GetGachaRewardItemLsit(12, CurRateTabIdx);
            break;

        case eRateViewType.item:    //13
            list = _LowDataMgr.instance.GetGachaRewardItemLsit(13, CurRateTabIdx);
            break;

        case eRateViewType.piece:    //11
            list = _LowDataMgr.instance.GetGachaRewardItemLsit(11, CurRateTabIdx);
            break;

        case eRateViewType.etc:    //8 , 10, 14
            list = _LowDataMgr.instance.GetGachaRewardItemLsit(8, CurRateTabIdx);
            list.InsertRange(list.Count, _LowDataMgr.instance.GetGachaRewardItemLsit(10, CurRateTabIdx));
            list.InsertRange(list.Count, _LowDataMgr.instance.GetGachaRewardItemLsit(14, CurRateTabIdx));
            break;
        }

        byte charClass = _LowDataMgr.instance.GetCharcterData(NetData.instance.GetUserInfo()._userCharIndex).Class;

        for (int i = 0; i < RateGrid.transform.childCount; i++)
        {
            if (i >= list.Count || list[i].ClassType != 99 && list[i].ClassType != charClass)
            {
                RateGrid.transform.GetChild(i).gameObject.SetActive(false);
                continue;
            }

            GameObject slot = RateGrid.transform.GetChild(i).gameObject;
            slot.SetActive(true);

            UISprite itemImg = slot.transform.FindChild("imgae").GetComponent <UISprite>();       //아이콘
            UILabel  name    = slot.transform.FindChild("Txt_itemname").GetComponent <UILabel>(); //이름
            UILabel  percent = slot.transform.FindChild("Txt_percent").GetComponent <UILabel>();
            UILabel  amount  = slot.transform.FindChild("Txt_amount").GetComponent <UILabel>();   //개수
            UISprite grade   = itemImg.transform.FindChild("grade").GetComponent <UISprite>();
            UISprite gradeBg = itemImg.transform.FindChild("bg_grade").GetComponent <UISprite>();

            percent.text = string.Format("{0} : {1}%", _LowDataMgr.instance.GetStringCommon(949), (list[i].ItemIdxRate * 0.0001).ToString());//만분률
            amount.text  = list[i].ShardMin <= 1 ? "" : list[i].ShardMin.ToString();

            uint itemIdx = list[i].ItemIdx;
            if (0 < itemIdx)
            {
                if (list[i].Type == 12)//장비임
                {
                    Item.EquipmentInfo eLowData = _LowDataMgr.instance.GetLowDataEquipItemInfo(itemIdx);
                    if (eLowData != null)//장비아이템이 드랍아이템 대표로 등록되어 있음
                    {
                        itemImg.atlas = AtlasMgr.instance.GetLoadAtlas(PoolAtlasType.EquipItem);

                        itemImg.spriteName = _LowDataMgr.instance.GetLowDataIcon(eLowData.Icon);
                        name.text          = string.Format("{0}{1}[-]", UIHelper.GetItemGradeColor(eLowData.Grade), _LowDataMgr.instance.GetStringItem(eLowData.NameId));

                        grade.spriteName   = string.Format("Icon_0{0}", eLowData.Grade);
                        gradeBg.spriteName = string.Format("Icon_bg_0{0}", eLowData.Grade);
                    }
                }
                else if (list[i].Type == 10)// 초상화일수있으니 다시검ㅅ ㅏ&& _LowDataMgr.instance.IsGetRewardType(10, itemIdx)
                {
                    itemImg.atlas = AtlasMgr.instance.GetLoadAtlas(LoadAtlasType.Face);

                    Partner.PartnerDataInfo pInfo = _LowDataMgr.instance.GetPartnerInfo(itemIdx);
                    if (pInfo == null)
                    {
                        RateGrid.transform.GetChild(i).gameObject.SetActive(false);
                        continue;
                    }

                    itemImg.spriteName = pInfo.PortraitId;
                    name.text          = string.Format("{0}{1}[-]", UIHelper.GetItemGradeColor(pInfo.Quality), _LowDataMgr.instance.GetStringUnit(pInfo.NameId));
                    grade.spriteName   = string.Format("Icon_0{0}", pInfo.Quality);
                    gradeBg.spriteName = string.Format("Icon_bg_0{0}", pInfo.Quality);
                }
                else//소비아이템
                {
                    Item.ItemInfo uLowData = _LowDataMgr.instance.GetUseItem(itemIdx);
                    name.text        = string.Format("{0}{1}[-]", UIHelper.GetItemGradeColor(uLowData.Grade), _LowDataMgr.instance.GetStringItem(uLowData.NameId));
                    grade.spriteName = string.Format("Icon_0{0}", uLowData.Grade);

                    if (uLowData.Type == (int)AssetType.Jewel)
                    {
                        gradeBg.atlas      = AtlasMgr.instance.GetLoadAtlas(PoolAtlasType.EquipItem);
                        gradeBg.spriteName = string.Format("Icon_bg_0{0}", uLowData.Grade);
                    }
                    else
                    {
                        gradeBg.atlas      = AtlasMgr.instance.GetLoadAtlas(PoolAtlasType.Bod);
                        gradeBg.spriteName = "Bod_IconBg";
                    }

                    if (uLowData.Type == (int)AssetType.PartnerShard || uLowData.Type == (int)AssetType.CostumeShard)
                    {
                        itemImg.atlas = AtlasMgr.instance.GetLoadAtlas(LoadAtlasType.Shard);
                        //gradeBg.atlas = AtlasMgr.instance.GetLoadAtlas(PoolAtlasType.Bod);
                        //gradeBg.spriteName = "Bod_IconBg";
                    }
                    else
                    {
                        itemImg.atlas = AtlasMgr.instance.GetLoadAtlas(LoadAtlasType.UseItem);
                    }

                    itemImg.spriteName = _LowDataMgr.instance.GetLowDataIcon(uLowData.Icon);
                }
            }
            else//아이템 아이디가 없는것들
            {
                switch (list[i].Type)
                {
                case 1:    //게임 머니
                    itemIdx = 599000;
                    break;

                case 8:    //에너지
                    itemIdx = 599104;
                    break;

                case 2:    //게임 캐쉬(원보)
                    itemIdx = 599001;
                    break;

                case 5:    //휘장
                    itemIdx = 599002;
                    break;

                case 7:    //성망
                    itemIdx = 599003;
                    break;

                case 3:    //공헌
                    itemIdx = 599004;
                    break;

                case 4:    //명예
                    itemIdx = 599005;
                    break;

                case 6:    //사자왕휘장
                    itemIdx = 599006;
                    break;
                }

                if (itemIdx <= 0)
                {
                    Debug.LogError("UnDefined type error " + list[i].Type);
                    continue;
                }
                Item.ItemInfo uLowData = _LowDataMgr.instance.GetUseItem(itemIdx);

                itemImg.atlas      = AtlasMgr.instance.GetLoadAtlas(LoadAtlasType.UseItem);
                itemImg.spriteName = _LowDataMgr.instance.GetLowDataIcon(uLowData.Icon);

                name.text        = string.Format("{0}{1}[-]", UIHelper.GetItemGradeColor(uLowData.Grade), _LowDataMgr.instance.GetStringItem(uLowData.NameId));
                grade.spriteName = string.Format("Icon_0{0}", uLowData.Grade);
            }

            int idx = i;
            EventDelegate.Set(slot.GetComponent <UIEventTrigger>().onClick, delegate()
            {
                if (itemIdx <= 0 || list[idx].Type == 10 || list[idx].Type == 14)//list[idx].Type == 1 ||list[idx].Type == 10 || list[idx].Type == 8 ||
                {
                    return;
                }

                Vector2 position = itemImg.transform.position;
                OnclicItemPopup(itemIdx);
            });
        }

        RateGrid.repositionNow = true;
        RateScroll.ResetPosition();
    }
コード例 #17
0
ファイル: Pc.cs プロジェクト: yonghoKim365/myProject_2020_05
    public override void AttachWeaponEffect()
    {
        //어차피 몬스터랑 유닛이랑 다르게 처리
        //base.AttachWeaponEffect();
        string EffectRootName = "";

        if (syncData._isPartner)
        {
            Partner.PartnerDataInfo partner = _LowDataMgr.instance.GetPartnerInfo(syncData._partnerID);

            if (partner != null)
            {
                if (!partner.RightWeaDummy.Equals("none"))
                {
                    EffectRootName   = string.Format("Effect/_PARTNER/{0}", partner.RightWeaDummy);
                    WeaponEffects[0] = AttachedWeaponEffect(EffectRootName, "wp_dummy_01", gameObject);
                }

                if (!partner.LeftWeaDummy.Equals("none"))
                {
                    EffectRootName   = string.Format("Effect/_PARTNER/{0}", partner.LeftWeaDummy);
                    WeaponEffects[1] = AttachedWeaponEffect(EffectRootName, "wp_dummy_02", gameObject);
                }
            }
        }
        else//Hero?
        {
            if (syncData._HideCostume)
            {
                Item.EquipmentInfo weaponItem = _LowDataMgr.instance.GetLowDataEquipItemInfo(syncData._WeaponItem);

                if (weaponItem != null)
                {
                    if (!weaponItem.RightWeaDummy.Equals("none"))
                    {
                        EffectRootName   = string.Format("Effect/_PC/{0}", weaponItem.RightWeaDummy);
                        WeaponEffects[0] = AttachedWeaponEffect(EffectRootName, "wp_dummy_01", gameObject);
                    }
                    if (!weaponItem.LeftWeaDummy.Equals("none"))
                    {
                        EffectRootName   = string.Format("Effect/_PC/{0}", weaponItem.LeftWeaDummy);
                        WeaponEffects[1] = AttachedWeaponEffect(EffectRootName, "wp_dummy_02", gameObject);
                    }
                }
            }
            else
            {
                Item.CostumeInfo costume = _LowDataMgr.instance.GetLowDataCostumeInfo(syncData._CostumeItem);

                if (costume != null)
                {
                    if (!costume.RightWeaDummy.Equals("none"))
                    {
                        EffectRootName   = string.Format("Effect/_PC/{0}", costume.RightWeaDummy);
                        WeaponEffects[0] = AttachedWeaponEffect(EffectRootName, "wp_dummy_01", gameObject);
                    }

                    if (!costume.LeftWeaDummy.Equals("none"))
                    {
                        EffectRootName   = string.Format("Effect/_PC/{0}", costume.LeftWeaDummy);
                        WeaponEffects[1] = AttachedWeaponEffect(EffectRootName, "wp_dummy_02", gameObject);
                    }
                }
            }
        }
    }
コード例 #18
0
    public void SetBullewtin(int bulletType, uint lowDataId, uint grade, uint enchant, int opt, string userName, string dataStr)
    {
        string getName = null;

        switch ((Sw.eDynamicBulletinType)bulletType)                //아이템의 이름 정의
        {
        case Sw.eDynamicBulletinType.DynamicBulletinType_Equipment: //장비
            Item.EquipmentInfo itemInfo = _LowDataMgr.instance.GetLowDataEquipItemInfo(lowDataId);
            if (itemInfo == null)
            {
                return;
            }

            getName = string.Format("{0}{1}[-]"    // [FFE400]+{2}[-]
                                    , UIHelper.GetItemGradeColor(itemInfo.Grade)
                                    , _LowDataMgr.instance.GetStringItem(itemInfo.NameId));
            //, pmsgDynamicBulletinSynInfoS.UnCount);
            break;

        case Sw.eDynamicBulletinType.DynamicBulletinType_Hero:    //파트너
            Partner.PartnerDataInfo parInfo = _LowDataMgr.instance.GetPartnerInfo(lowDataId);
            if (parInfo == null)
            {
                return;
            }

            getName = string.Format("{0}{1}[-]"    // [FFE400]+{2}[-]
                                    , UIHelper.GetItemGradeColor((int)grade)
                                    , _LowDataMgr.instance.GetStringUnit(parInfo.NameId));
            //, pmsgDynamicBulletinSynInfoS.UnCount
            break;

        default:
            Debug.LogError(string.Format("unDefined type = {0}", (Sw.eDynamicBulletinType)bulletType));
            break;
        }

        if (string.IsNullOrEmpty(getName))
        {
            return;
        }

        string broadCasting = null;

        switch ((Sw.eDynamicBulletinOperateType)opt)
        {
        case Sw.eDynamicBulletinOperateType.DynamicBulletinOperateType_Null:              //획득?

            if (bulletType == (int)Sw.eDynamicBulletinType.DynamicBulletinType_Equipment) //장비
            {
                uint contantId = 0;
                switch ((Sw.ITEM_OPT_TYPE)opt)                   //획득 어디인지 판별
                {
                case Sw.ITEM_OPT_TYPE.EQUIPMENT_OPT_ADD_GM_TEST: //GM테스트
                    contantId = 673;
                    break;

                case Sw.ITEM_OPT_TYPE.EQUIPMENT_OPT_ADD_ITEM_FUSION:                     //아이템 합성
                    contantId = 33;
                    break;

                //case ITEM_OPT_TYPE.EQUIPMENT_OPT_ADD_NEWBIE:                  //뉴비 증정
                //    contantId = 33;
                //    break;
                case Sw.ITEM_OPT_TYPE.EQUIPMENT_OPT_ADD_STAGE_VICTORY:                   //시나리오 스테이지 승리
                    contantId = 9;
                    break;

                case Sw.ITEM_OPT_TYPE.EQUIPMENT_OPT_ADD_EMAIL:                           //메일
                    contantId = 136;
                    break;

                case Sw.ITEM_OPT_TYPE.EQUIPMENT_OPT_ADD_TOWER_VICTORY:                   //마탑 던전 승리
                    contantId = 194;
                    break;

                case Sw.ITEM_OPT_TYPE.EQUIPMENT_OPT_ADD_SHOP_BY:                         //상점 구매
                    contantId = 462;
                    break;

                case Sw.ITEM_OPT_TYPE.EQUIPMENT_OPT_ADD_BOSS_VICTORY:                    //보스 던전 승리
                    contantId = 917;
                    break;

                case Sw.ITEM_OPT_TYPE.EQUIPMENT_OPT_ADD_MESS_VICTORY:                    //난투장 드랍
                    contantId = 12;
                    break;

                case Sw.ITEM_OPT_TYPE.EQUIPMENT_OPT_ADD_TASK: //통상 퀘스트
                    contantId = 245;                          //퀘스트 : 244
                    break;

                case Sw.ITEM_OPT_TYPE.EQUIPMENT_OPT_ADD_TASK_DAILY:                      //일일 퀘스트
                    contantId = 246;
                    break;

                case Sw.ITEM_OPT_TYPE.EQUIPMENT_OPT_ADD_COMMON_POTTERY:                  //보통 뽑기 1회
                case Sw.ITEM_OPT_TYPE.EQUIPMENT_OPT_ADD_COMMON_POTTERY_MANYTIMES:        //보통 뽑기 10연뽑
                case Sw.ITEM_OPT_TYPE.EQUIPMENT_OPT_ADD_SENIOR_POTTERY:                  //고급뽑기 1회
                case Sw.ITEM_OPT_TYPE.EQUIPMENT_OPT_ADD_SENIOR_POTTERY_MANYTIMES:        //고급 뽑기 10연뽑
                case Sw.ITEM_OPT_TYPE.EQUIPMENT_OPT_ADD_COMMON_POTTERY_FREE:             //무료 보통 뽑기
                case Sw.ITEM_OPT_TYPE.EQUIPMENT_OPT_ADD_SENIOR_POTTERY_FREE:             //무료 고급 뽑기
                    contantId = 539;
                    break;

                default:
                    Debug.LogError(string.Format("unDefined type = {0}", (Sw.ITEM_OPT_TYPE)opt));
                    break;
                }

                broadCasting = string.Format(_LowDataMgr.instance.GetStringCommon(1054), userName, _LowDataMgr.instance.GetStringCommon(contantId), getName);
            }
            else    //파트너
            {
                broadCasting = string.Format(_LowDataMgr.instance.GetStringCommon(1055), getName, userName);
            }

            break;

        case Sw.eDynamicBulletinOperateType.DynamicBulletinOperateType_Enchant:    //강화
            broadCasting = string.Format(_LowDataMgr.instance.GetStringCommon(1056), userName, getName, enchant);
            break;

        case Sw.eDynamicBulletinOperateType.DynamicBulletinOperateType_Evolve:    //승급
            broadCasting = string.Format(_LowDataMgr.instance.GetStringCommon(1057), userName, getName, grade);
            break;

        default:
            Debug.LogError(string.Format("unDefined type = {0}", (Sw.eDynamicBulletinOperateType)opt));
            break;
        }

        if (string.IsNullOrEmpty(broadCasting))
        {
            return;
        }

        UIBasePanel chatPop = UIMgr.GetUIBasePanel("UIPopup/ChatPopup", false);

        if (chatPop != null)
        {
            if (string.IsNullOrEmpty(dataStr))
            {
                (chatPop as ChatPopup).OnReciveChat(broadCasting, ChatType.World);
            }
            else
            {
                (chatPop as ChatPopup).OnReciveChat(string.Format("[url=item/{0}]{1}[/url]", dataStr, broadCasting), ChatType.World);
            }
        }

        SetNoticePanel(NoticeType.Game, 0, broadCasting);
    }
コード例 #19
0
    /// <summary> 아이템의 테이블 아이디로 셋팅을 함.</summary>
    public void SetLowDataItemSlot(uint lowDataIdx, uint amount, Action <ulong> callBack = null)
    {
        EnchantLv.gameObject.SetActive(false);
        if (lowDataIdx < 100)
        {
            //string iconName = null;
            switch ((Sw.UNITE_TYPE)lowDataIdx)
            {
            case Sw.UNITE_TYPE.UNITE_TYPE_COIN:
                lowDataIdx = 599000;
                break;

            case Sw.UNITE_TYPE.UNITE_TYPE_GEM:
                lowDataIdx = 599001;
                break;

            case Sw.UNITE_TYPE.UNITE_TYPE_CONTRIBUTION:
                lowDataIdx = 599004;
                break;

            case Sw.UNITE_TYPE.UNITE_TYPE_HONOR:
                lowDataIdx = 599005;
                break;

            case Sw.UNITE_TYPE.UNITE_TYPE_ROYAL_BADGE:
                lowDataIdx = 599002;
                break;

            case Sw.UNITE_TYPE.UNITE_TYPE_LION_KING_BADGE:
                lowDataIdx = 599006;
                break;

            case Sw.UNITE_TYPE.UNITE_TYPE_FAME:
                lowDataIdx = 599003;
                break;

            case Sw.UNITE_TYPE.UNITE_TYPE_POWER:
                lowDataIdx = 599104;
                break;

            case Sw.UNITE_TYPE.UNITE_TYPE_ROLE_EXP:
                lowDataIdx = 599105;
                break;
            //case Sw.UNITE_TYPE.UNITE_TYPE_TITLE:

            //    break;

            default:
                Debug.Log("unDefined type error " + (Sw.UNITE_TYPE)lowDataIdx);
                EmptySlot();
                return;
            }

            //if( string.IsNullOrEmpty(iconName ) )
            //{
            //    Debug.LogError(string.Format("not setting image name error {0}", (Sw.UNITE_TYPE)lowDataIdx ) );
            //}

            //ItemIcon.atlas = _AtlasMgr.GetLoadAtlas(LoadAtlasType.UseItem);
            //SetDefault(iconName, "", amount, "Bod_IconBg");
        }

        Item.EquipmentInfo equip = _LowDataMgr.instance.GetLowDataEquipItemInfo(lowDataIdx);
        if (equip != null)
        {
            SetEquipItem(equip, amount);
        }
        else
        {
            Item.ItemInfo useLowData = _LowDataMgr.instance.GetUseItem(lowDataIdx);
            if (useLowData == null)//파트너?
            {
                SetPartnerItem(lowDataIdx, amount);
            }
            else if (useLowData != null)
            {
                SetUseItem(useLowData, amount);
            }
            else
            {
                EmptySlot();
            }
        }

        if (callBack != null && 100 < lowDataIdx)
        {
            Key      = lowDataIdx;
            CallBack = callBack;
        }
    }
コード例 #20
0
    public void ViewInfo(uint type, NetData.ShopItemInfoData shopInfo)
    {
        ScrollView.gameObject.SetActive(shopInfo == null ? false : true);
        EmptyTxt.SetActive(shopInfo == null? true:false);
        if (/*!ScrollView.gameObject.activeSelf*/ shopInfo == null)
        {
            return;
        }

        int shopCnt = shopInfo.shopInfo.Count;

        CurShopType = shopInfo.Type;
        RefreshCash(CurShopType);

        bool IsTimeReset = true;

        if (CurShopType == 101)
        {
            IsTimeReset = false;
        }
        if (CurShopType == 201)
        {
            IsTimeReset = false;
        }
        if (CurShopType == 202)
        {
            IsTimeReset = false;
        }
        if (CurShopType == 102)
        {
            IsTimeReset = false;
        }

        TimeRoot.gameObject.SetActive(IsTimeReset);
        TimeItemInfo.gameObject.SetActive(!TimeRoot.gameObject.activeSelf);
        ResetBtn.transform.gameObject.SetActive(IsTimeReset);

        if (CurViewType != eMainTab.CHANGE)
        {
            TimeRoot.gameObject.SetActive(false);
            ResetBtn.transform.gameObject.SetActive(false);
        }

        if (IsTimeReset)
        {
            RefreshTime = shopInfo.RefreshTimer.ToString();
            // 리셋비용을 얻기위해
            PriceList = _LowDataMgr.instance.GetLowDataPrice(shopInfo.Type);
        }

        GoodsName.text     = "";
        GoodsInfo.text     = "";
        UseSellAmount      = 0;
        UseSellTotalAmount = 0;
        TotalNum.text      = "0";
        TotalPrice.text    = "0";
        TimeItemInfo.text  = "";


        bool isFirstSelect = false;

        int childCount = 0;

        for (int i = 0; i < Grid.transform.childCount; i++)
        {
            if (i >= shopCnt)
            {
                Grid.transform.GetChild(i).gameObject.SetActive(false);
                continue;
            }

            Transform slotTf = Grid.transform.GetChild(i);
            slotTf.gameObject.SetActive(true);

            NetData.ShopItemInfo info      = shopInfo.shopInfo[i];
            Shop.ShopInfo        shopTable = _LowDataMgr.instance.GetLowDataShopById(info.DbIndex);

            if (shopTable == null)
            {
                Grid.transform.GetChild(i).gameObject.SetActive(false);
                continue;
            }

            //한정판매 일때는 기간지나면 목록에서 없앰
            if (shopTable.shopopentime != 0)
            {
                DateTime startTime = DateTime.ParseExact(shopTable.shopopentime.ToString(), "yyyyMMddHHmmss", null);
                DateTime endTime   = DateTime.ParseExact(shopTable.shopclosetime.ToString(), "yyyyMMddHHmmss", null);

                if (startTime.CompareTo(DateTime.Now) < 0) // 오늘이 시작날짜보다 빠르다면
                {
                    slotTf.gameObject.SetActive(false);
                    continue;
                }

                if (endTime.CompareTo(DateTime.Now) > 0) //오늘이 완료날짜보다 늦다면
                {
                    slotTf.gameObject.SetActive(false);
                    continue;
                }
            }

            // 갯수 1개는 표시x , 2개부터 표시해줌
            UILabel Count = slotTf.FindChild("cnt").GetComponent <UILabel>();
            Count.text = info.Account.ToString();
            Count.gameObject.SetActive(info.Account > 1 ? true : false);

            UISprite moneyIcon = slotTf.FindChild("Img_Money").GetComponent <UISprite>();
            moneyIcon.spriteName = MoneyImg.spriteName;

            UILabel name  = slotTf.FindChild("name").GetComponent <UILabel>();
            UILabel price = slotTf.FindChild("price").GetComponent <UILabel>();

            price.text = shopTable.cost.ToString();
            Item.EquipmentInfo eLowData = _LowDataMgr.instance.GetLowDataEquipItemInfo(info.GoodsId);
            if (eLowData != null)//장비아이템이 드랍아이템 대표로 등록되어 있음
            {
                name.color = GradeNameColor[eLowData.Grade];
                name.text  = _LowDataMgr.instance.GetStringItem(eLowData.NameId);
            }
            else//소모아이템이 드랍아이템 대표로 등록되어 있음
            {
                Item.ItemInfo uLowData = _LowDataMgr.instance.GetUseItem(info.GoodsId);
                if (uLowData == null)
                {
                    continue;
                }

                name.color = GradeNameColor[uLowData.Grade];
                name.text  = _LowDataMgr.instance.GetStringItem(uLowData.NameId);
            }


            int idx = i;

            //슬롯눌럿을경우 선택
            EventDelegate.Set(slotTf.GetComponent <UIEventTrigger>().onClick, delegate()
            {
                if (0 < info.Account)
                {
                    OnclicItemPopup(info, int.Parse(price.text), name.color);
                }

                for (int j = 0; j < SelEff.Length; j++)
                {
                    SelEff[j].SetActive(j == idx);
                }
            });

            //아이콘일경우 팝업
            slotTf.FindChild("root").GetChild(0).GetComponent <InvenItemSlotObject>().SetLowDataItemSlot(info.GoodsId, 0, (key) =>
            {
                UIMgr.OpenDetailPopup(this, info.GoodsId);
            });

            //매진팝업
            Transform soldOut      = slotTf.FindChild("soldout").GetComponent <Transform>();
            Transform soldOutStemp = slotTf.FindChild("Stemp").GetComponent <Transform>();

            soldOut.gameObject.SetActive(false);
            soldOutStemp.gameObject.SetActive(false);

            // 한개 이상이면 구매팝업창으로
            if (info.Account < 1)
            {
                soldOut.gameObject.SetActive(true);
                soldOutStemp.gameObject.SetActive(true);
            }


            //매진이아닌 아이템이 최초선택된채로 시작.
            if (!isFirstSelect && !soldOutStemp.gameObject.activeSelf && !isResetSelect)
            {
                OnclicItemPopup(info, int.Parse(price.text), name.color);

                for (int j = 0; j < SelEff.Length; j++)
                {
                    SelEff[j].SetActive(j == idx);
                }

                isFirstSelect = true;
            }
            childCount++;
        }

        //초기화
        EventDelegate.Set(ResetBtn.onClick, delegate()
        {
            OnclickReset((int)shopInfo.ManualRefreshCount, (int)shopInfo.Type);
        });
        EmptyTxt.SetActive(shopInfo == null /*!Grid.transform.GetChild(0).gameObject.activeSelf*/);
        Grid.Reposition();
        ScrollView.enabled = childCount > 10;
        isResetSelect      = false;
    }
コード例 #21
0
    void SetItem()
    {
        for (int i = 0; i < ids.Count; i++)
        {
            Transform slot = ItemRoot.GetChild(i);

            UISprite img = slot.GetComponent <UISprite>();

            Item.EquipmentInfo eLowData = _LowDataMgr.instance.GetLowDataEquipItemInfo(ids[i]);
            if (eLowData != null)//장비아이템이 드랍아이템 대표로 등록되어 있음
            {
                if (img.atlas != EquipAtlas)
                {
                    img.atlas = EquipAtlas;
                }

                img.spriteName = _LowDataMgr.instance.GetLowDataIcon(eLowData.Icon);
            }
            else//소모아이템이 드랍아이템 대표로 등록되어 있음
            {
                Item.ItemInfo uLowData = _LowDataMgr.instance.GetUseItem(ids[i]);
                if (uLowData == null)
                {
                    //Debug.LogError("item id error" + ids[i]);
                    //continue;
                    //따로체크
                    if (img.atlas != UseAtlas)
                    {
                        img.atlas = UseAtlas;
                    }

                    if (type[i] == 1)//골드
                    {
                        img.spriteName = "Icon_10000";
                    }
                    if (type[i] == 2)//원보
                    {
                        img.spriteName = "Icon_10001";
                    }
                    if (type[i] == 3)//공헌
                    {
                        img.spriteName = "Icon_10006";
                    }
                    if (type[i] == 4)//명ㅇㅖ
                    {
                        img.spriteName = "Icon_10007";
                    }
                    if (type[i] == 5)//휘장
                    {
                        img.spriteName = "Icon_10002";
                    }
                    if (type[i] == 6)//사자휘장
                    {
                        img.spriteName = "Icon_10008";
                    }
                    if (type[i] == 7)//성망
                    {
                        img.spriteName = "Icon_10005";
                    }
                    if (type[i] == 8)//체력
                    {
                        img.spriteName = "Icon_10009";
                    }
                    if (type[i] == 10)  //파트너
                    {
                        if (_LowDataMgr.instance.IsGetRewardType(10, ids[i]))
                        {
                            if (img.atlas != Face)
                            {
                                img.atlas = Face;
                            }

                            img.spriteName = _LowDataMgr.instance.GetPartnerInfo(ids[i]).PortraitId;
                        }
                    }
                }
                else
                {
                    if (img.atlas != UseAtlas)
                    {
                        img.atlas = UseAtlas;
                    }

                    img.spriteName = _LowDataMgr.instance.GetLowDataIcon(uLowData.Icon);
                }
            }


            // 아이템 상세팝업
            UIEventTrigger triItem = slot.GetComponent <UIEventTrigger>();
            int            idx     = i;
            EventDelegate.Set(triItem.onClick, delegate() { OnclicItemPopup(ids[idx]); });
        }
    }
コード例 #22
0
    /// <summary> 비동기 방식의 게임들 결과화면 </summary>
    void ResultDungeon()
    {
        if (G_GameInfo.GameMode == GAME_MODE.SINGLE)
        {
            //현재 최초보상받을수있는지 체크?
            DungeonTable.StageInfo lowData = _LowDataMgr.instance.GetStageInfo(SingleGameState.lastSelectStageId);
            if (lowData != null)
            {
                //if (lowData.type == 2 && isSuccess)
                // {
                if (SingleGameState.IsFirstReward)
                {
                    GatchaReward.FixedRewardInfo firstInfo = _LowDataMgr.instance.GetFixedRewardItem(lowData.FirstReward);

                    //최초보상받을시기?
                    GameObject go = Instantiate(ItemSlotPrefab) as GameObject;
                    Transform  tf = go.transform;
                    tf.parent        = FirstRewardPopup.transform.FindChild("Icon").transform;
                    tf.localPosition = Vector3.zero;
                    tf.localScale    = Vector3.one;

                    UILabel name = FirstRewardPopup.transform.FindChild("Txt_Iconname").GetComponent <UILabel>();

                    InvenItemSlotObject slotObj = go.GetComponent <InvenItemSlotObject>();
                    slotObj.SetLowDataItemSlot(firstInfo.ItemId == 0? firstInfo.Type : firstInfo.ItemId, firstInfo.ItemCount);

                    Item.EquipmentInfo equipInfo = _LowDataMgr.instance.GetLowDataEquipItemInfo(firstInfo.ItemId);
                    if (equipInfo != null) //장비
                    {
                        name.text = _LowDataMgr.instance.GetStringItem(equipInfo.NameId);
                    }
                    else
                    {
                        uint id = 0;
                        //혹시 재화인가....
                        if (firstInfo.ItemId == 0)
                        {
                            switch (firstInfo.Type)
                            {
                            case 1:    //골드
                                id = 599000;
                                break;

                            case 2:    //원보
                                id = 599001;
                                break;

                            case 3:    //공헌
                                id = 599004;
                                break;

                            case 4:    //명예
                                id = 599005;
                                break;

                            case 5:    //휘장
                                id = 599002;
                                break;

                            case 6:    //사자왕
                                id = 599006;
                                break;

                            case 7:    //성망
                                id = 599003;
                                break;

                            case 8:    //체력
                                id = 599104;
                                break;

                            case 9:    //경험치;
                                id = 599105;
                                break;
                            }

                            name.text = _LowDataMgr.instance.GetStringItem(_LowDataMgr.instance.GetUseItem(firstInfo.ItemId == 0 ? id : firstInfo.ItemId).NameId);
                        }
                        else
                        {
                            name.text = _LowDataMgr.instance.GetStringItem(_LowDataMgr.instance.GetUseItem(firstInfo.ItemId).NameId);
                        }
                    }

                    SetRenderQueue renderQ = UIHelper.FindComponent <SetRenderQueue>(FirstRewardPopup.transform.FindChild("Effect"));
                    if (renderQ != null)
                    {
                        renderQ.ResetRenderQ(3031);
                    }

                    FirstRewardPopup.SetActive(true);

                    TempCoroutine.instance.FrameDelay(0.1f, () =>
                    {
                        FirstRewardPopup.transform.GetComponent <TweenScale>().ResetToBeginning();
                        FirstRewardPopup.transform.GetComponent <TweenScale>().PlayForward();
                    });

                    TempCoroutine.instance.FrameDelay(3f, () =>
                    {
                        FirstRewardPopup.SetActive(false);
                    });
                }
            }
            // }

            if (isSuccess && SceneManager.instance.CurTutorial == TutorialType.STAGE)//튜토리얼 중 스테이지 클리어했다면
            {
                SceneManager.instance.CurTutorial = TutorialType.STAGE;
            }
        }

        Reward = NetData.instance._RewardData;
        if (Reward == null)//없으면 안돼겠지만. 뻑은 안나게..
        {
            Reward = new NetData.RewardData();
        }

        uint curExp = 0, maxExp = 0, level = 0;

        if (Reward.GetExp <= 0)//획득 경험치가 있다면 뭔가 데이터가 있다는 것임.
        {
            level = NetData.instance.UserLevel;
            NetData.instance.GetUserInfo().GetCurrentAndMaxExp(ref curExp, ref maxExp);
        }
        else
        {
            curExp = Reward.SaveExp;
            maxExp = Reward.SaveMaxExp;
            level  = Reward.SaveLevel;
        }

        ExpGauge.value = (float)curExp / (float)maxExp;
        Labels[(int)labelT.hLv].text = string.Format(_LowDataMgr.instance.GetStringCommon(453), level);

        SettingRewardItem();

        if (G_GameInfo.GameMode == GAME_MODE.SINGLE)//싱글게임에만 스테이지 퀘스트가 존재.
        {
            StartCoroutine("MissionResult");
        }
        else if (G_GameInfo.GameMode != GAME_MODE.ARENA)
        {
            Result();
        }

        if (isSuccess)
        {
            TitleObj[0].SetActive(true);
            UIHelper.CreateEffectInGame(TitleObj[0].transform.FindChild("bg"), "Fx_UI_exp_result_01");
        }
        else
        {
            TitleObj[1].SetActive(true);
        }
    }