Esempio n. 1
0
 public void SetDetail(ItemOfReward mreward)
 {
     _ItemOfReward = mreward;
     if (mreward.getCurType() == ConfigDataType.Monster)
     {
         Monster data = mreward.toMonster(Core.Data.monManager);
         ShowMonster(data);
     }
     else if (mreward.getCurType() == ConfigDataType.Equip)
     {
         Equipment data = mreward.toEquipment(Core.Data.EquipManager, Core.Data.gemsManager);
         ShowEquip(data);
     }
     else if (mreward.getCurType() == ConfigDataType.Gems)
     {
         Gems data = mreward.toGem(Core.Data.gemsManager);
         ShowGem(data);
     }
     else if (mreward.getCurType() == ConfigDataType.Frag)
     {
         Soul data = mreward.toSoul(Core.Data.soulManager);
         ShowFrag(data);
     }
     else if (mreward.getCurType() == ConfigDataType.Item)
     {
         Item item = mreward.toItem(Core.Data.itemManager);
         ShowItem(item);
     }
     else
     {
         RED.LogWarning("unknow reward type");
     }
     _Head.MakePixelPerfect();
 }
Esempio n. 2
0
    void ShowIcon()
    {
        if (m_nIndex >= m_data.Length)
        {
            return;
        }
        ItemOfReward reward = m_data [m_nIndex];

        if (reward.getCurType() == ConfigDataType.Monster)
        {
            Monster data = reward.toMonster(Core.Data.monManager);
            rewardName.text = data.config.name;
            AtlasMgr.mInstance.SetHeadSprite(rewardIcon, data.num.ToString());
        }
        else if (reward.getCurType() == ConfigDataType.Equip)
        {
            Equipment data = reward.toEquipment(Core.Data.EquipManager, Core.Data.gemsManager);
            rewardName.text       = data.ConfigEquip.name;
            rewardIcon.atlas      = AtlasMgr.mInstance.equipAtlas;
            rewardIcon.spriteName = data.Num.ToString();
        }
        else if (reward.getCurType() == ConfigDataType.Gems)
        {
            Gems data = reward.toGem(Core.Data.gemsManager);
            rewardName.text       = data.configData.name;
            rewardIcon.atlas      = AtlasMgr.mInstance.commonAtlas;
            rewardIcon.spriteName = data.configData.anime2D;
        }
        else if (reward.getCurType() == ConfigDataType.Item)
        {
            Item item = reward.toItem(Core.Data.itemManager);
            rewardName.text  = item.configData.name;
            rewardIcon.atlas = AtlasMgr.mInstance.itemAtlas;
//            rewardIcon.spriteName = item.RtData.num.ToString ();
            rewardIcon.spriteName = item.configData.iconID.ToString();
        }
        else if (reward.getCurType() == ConfigDataType.Frag)
        {
            Soul soul = reward.toSoul(Core.Data.soulManager);
            rewardName.text       = soul.m_config.name;
            rewardIcon.atlas      = AtlasMgr.mInstance.itemAtlas;
            rewardIcon.spriteName = soul.m_RTData.num.ToString();
        }
        else
        {
            RED.LogWarning("unknow reward type");
        }
        rewardIcon.MakePixelPerfect();

        rewardNum.text = ItemNumLogic.setItemNum(reward.num, rewardNum, rewardNum.gameObject.transform.parent.gameObject.GetComponent <UISprite>());  // yangchenguang
    }
Esempio n. 3
0
    string GetRewardName(ItemOfReward reward)
    {
        string strName = "";

        if (reward.getCurType() == ConfigDataType.Monster)
        {
            Monster data = reward.toMonster(Core.Data.monManager);
            strName = data.config.name;
        }
        else if (reward.getCurType() == ConfigDataType.Equip)
        {
            Equipment data = reward.toEquipment(Core.Data.EquipManager, Core.Data.gemsManager);
            strName = data.ConfigEquip.name;
        }
        else if (reward.getCurType() == ConfigDataType.Gems)
        {
            Gems data = reward.toGem(Core.Data.gemsManager);
            strName = data.configData.name;
        }
        else if (reward.getCurType() == ConfigDataType.Frag)
        {
            Soul data = reward.toSoul(Core.Data.soulManager);
            strName = data.m_config.name;
        }
        else if (reward.getCurType() == ConfigDataType.Item)
        {
            ConfigDataType type = DataCore.getDataType(reward.pid);
            if (type == ConfigDataType.Item)
            {
                Item realItem = new Item();
                realItem.RtData     = new ItemInfo();
                realItem.RtData.num = reward.pid;
                realItem.configData = Core.Data.itemManager.getItemData(reward.pid);
                strName             = realItem.configData.name;
            }
            else if (type == ConfigDataType.Frag)
            {
                Soul soul = new Soul();
                soul.m_RTData       = new SoulInfo();
                soul.m_RTData.num   = reward.pid;
                soul.m_RTData.count = 1;
                soul.m_config       = Core.Data.soulManager.GetSoulConfigByNum(reward.pid);
                strName             = soul.m_config.name;
            }
        }
        return(strName);
    }
Esempio n. 4
0
    public void InitUI(ItemOfReward reward)
    {
        m_date     = reward;
        ShowTxtCnt = true;
        if (reward.getCurType() == ConfigDataType.Monster)
        {
            Monster data = reward.toMonster(Core.Data.monManager);
            ShowMonster(data);
        }
        else if (reward.getCurType() == ConfigDataType.Equip)
        {
            Equipment data = reward.toEquipment(Core.Data.EquipManager, Core.Data.gemsManager);
            ShowEquip(data);
        }
        else if (reward.getCurType() == ConfigDataType.Gems)
        {
            Gems data = reward.toGem(Core.Data.gemsManager);
            ShowGem(data);
        }
        else if (reward.getCurType() == ConfigDataType.Frag)
        {
            Soul data = reward.toSoul(Core.Data.soulManager);
            ShowFrag(data);
//			if (data.m_config.type == (int)ItemType.Monster_Frage)
//			{
//				ShowSoul (data);
//			}
//			else if(data.m_config.type == (int)ItemType.Nameike_Frage || data.m_config.type == Earth_Frage)
//			{
//				ShowFrag(data);
//			}
        }
        else if (reward.getCurType() == ConfigDataType.Item)
        {
            Item item = reward.toItem(Core.Data.itemManager);

            if (reward.showpid != 0)
            {
                ConfigDataType type = DataCore.getDataType(reward.pid);
                if (type == ConfigDataType.Item)
                {
                    Item realItem = new Item();
                    realItem.RtData     = new ItemInfo();
                    realItem.RtData.num = reward.pid;
                    realItem.configData = Core.Data.itemManager.getItemData(reward.pid);
                    ShowItem(realItem);
                }
                else if (type == ConfigDataType.Frag)
                {
                    Soul soul = new Soul();
                    soul.m_RTData       = new SoulInfo();
                    soul.m_RTData.num   = reward.pid;
                    soul.m_RTData.count = 1;
                    soul.m_config       = Core.Data.soulManager.GetSoulConfigByNum(reward.pid);
                    ShowFrag(soul);
                }
            }
            else
            {
                ShowItem(item);
            }
        }
        else if (reward.getCurType() == ConfigDataType.Frag)
        {
            Soul soul = reward.toSoul(Core.Data.soulManager);
            ShowFrag(soul);
        }
        else
        {
            RED.LogWarning("unknow reward type");
        }

        if (ShowTxtCnt)
        {
            RED.SetActive(reward.num > 1, m_cntRoot);
        }
        else
        {
            RED.SetActive(false, m_cntRoot);
        }

        m_txtCnt.text = ItemNumLogic.setItemNum(reward.num, m_txtCnt, m_cntRoot.GetComponent <UISprite>()); // yangchenguang
        m_spIcon.MakePixelPerfect();
    }