Beispiel #1
0
 public void SetRewardItem(int itemType, int id, int num)
 {
     if (itemType == 1)        //英雄整卡
     {
         s_soldier_typeInfo info = SoldierM.GetSoldierType(id);
         if (info == null)
         {
             NGUIUtil.DebugLog("s_soldiertype id = " + id + " 静态表数据未配置!");
             return;
         }
         else
         {
             SetHead(itemType, 0, info.modeltype);
             MyHead.SprQuality.spriteName = "1";
             MyHead.SprQuality.gameObject.SetActive(true);
         }
     }
     else if (itemType == 2)        //道具/碎片
     {
         s_itemtypeInfo info = ItemM.GetItemInfo(id);
         if (info == null)
         {
             NGUIUtil.DebugLog("s_itemtype id = " + id + " 静态表数据未配置!");
             return;
         }
         else
         {
             SetHead(info.gtype, info.icon, info.gid);
             int quality = ConfigM.GetBigQuality(info.quality);
             MyHead.SprQuality.spriteName = quality.ToString();
         }
     }
     else if (itemType == 3)        //陷阱
     {
         s_building_typeInfo buildinfo = buildingM.GetBuildType(id);
         MyHead.Roomhead.gameObject.SetActive(true);
         NGUIUtil.Set2DSprite(MyHead.Roomhead, "Textures/room/", buildinfo.modeltype.ToString());
         MyHead.SprQuality.spriteName = "1";
     }
     else if (itemType == 4)        //黑科技
     {
         string icon = "Textures/role/" + id;
         MyHead.SprQuality.gameObject.SetActive(true);
         MyHead.CaptainHead.gameObject.SetActive(true);
         NGUIUtil.Set2DSprite(MyHead.CaptainHead, icon);
         MyHead.SprQuality.spriteName = "1";
     }
 }
Beispiel #2
0
    /// <summary>
    /// 新手引导可用的简化接口
    /// </summary>
    public void SetTropiesData(int soldierTypeID)
    {
        s_itemtypeInfo              itypeInfo   = new s_itemtypeInfo();
        s_soldier_typeInfo          soldierInfo = SoldierM.GetSoldierType(soldierTypeID);
        List <sdata.s_itemtypeInfo> l           = new List <s_itemtypeInfo>();

        if (soldierInfo != null)
        {
            itypeInfo.name  = soldierInfo.name;
            itypeInfo.gtype = 1;
            itypeInfo.gid   = soldierTypeID;
        }
        if (itypeInfo != null)
        {
            l.Add(itypeInfo);
            AddTropiesData(l);
        }
    }
Beispiel #3
0
    private void SoldierSummonResponse(int nErrorCode)
    {
        if (nErrorCode == 0 && m_iWndType == 1)
        {
            GameObjectActionExcute gae      = GameObjectActionExcute.CreateExcute(gameObject);
            s_itemtypeInfo         info     = new s_itemtypeInfo();
            s_soldier_typeInfo     TypeInfo = SoldierM.GetSoldierType(m_soldierInfo.SoldierTypeID);
            if (TypeInfo != null)
            {
                info.name = TypeInfo.name;
            }
            info.gtype = 1;
            info.gid   = m_soldierInfo.SoldierTypeID;

            if (info == null)
            {
#if UNITY_EDITOR_LOG
                NGUIUtil.DebugLog("SoldierSummonResponse soldTypeId get s_itemtypeInfo is null" + soldTypeId.ToString());
#endif

                return;
            }
            List <s_itemtypeInfo> l = new List <s_itemtypeInfo>();
            l.Add(info);

            TrophiesActionWnd TropWnd = WndManager.GetDialog <TrophiesActionWnd>();
            if (TropWnd)
            {
                TropWnd.ClearTropiesData();
                TropWnd.AddTropiesData(l);
                TropWnd.SetWndType(3);
                TropWnd.MyHead.LblDes.gameObject.SetActive(false);
            }

            WndManager.DestoryDialog <SummonHeroWnd>();
        }
    }
Beispiel #4
0
    // isSoul是为了兼容闪亮登场界面的信息。
    public static ItemIconInfo GetIconInfo(IconType iconType, int id, bool isSoul, bool isBook)
    {
        ItemIconInfo iconInfo = new ItemIconInfo();

        if (iconType == IconType.IconType_Fragment)
        {
            if (isSoul)
            {
                int soldierTypeId       = SoldierM.GetSoldierStarID(id);
                s_soldier_typeInfo info = SoldierM.GetSoldierType(soldierTypeId);
                if (info == null)
                {
                    NGUIUtil.DebugLog("s_soldiertype id = " + id + " 静态表数据未配置!");
                    return(null);
                }
                else
                {
                    iconType = IconType.IconType_Soldier;
                    id       = info.modeltype;
                }
            }
            else if (isBook)
            {
                iconType = IconType.IconType_Captain;
                int godSkillType = GodSkillM.GetGodSkillType(id);
                id = GodSkillM.GetCaptainID(godSkillType);
            }
        }

        if (iconType == IconType.IconType_Soldier)        //英雄整卡
        {
            s_soldier_typeInfo info = SoldierM.GetSoldierType(id);
            if (info == null)
            {
                NGUIUtil.DebugLog("s_soldiertype id = " + id + " 静态表数据未配置!");
                return(null);
            }
            else
            {
                iconInfo.mType = iconType;
                iconInfo.mName = info.name;
                iconInfo.mID   = info.modeltype;
            }
        }
        else if (iconType == IconType.IconType_Fragment)        //道具/碎片
        {
            s_itemtypeInfo info = ItemM.GetItemInfo(id);
            if (info == null)
            {
                NGUIUtil.DebugLog("s_itemtype id = " + id + " 静态表数据未配置!");
                return(null);
            }
            else
            {
                iconInfo.mType = iconType;
                iconInfo.mName = info.name;
                int soldierTypeId = SoldierM.GetSoldierStarID(id);
                iconInfo.mID = info.gid;
            }
        }
        else if (iconType == IconType.IconType_Bulding)        //陷阱
        {
            s_building_typeInfo buildinfo = buildingM.GetBuildType(id);

            iconInfo.mType = iconType;
            iconInfo.mName = buildinfo.name;
            iconInfo.mID   = buildinfo.modeltype;
        }
        else if (iconType == IconType.IconType_Captain)        //黑科技
        {
            iconInfo.mType = iconType;
            CaptionInfo captionInfo = new CaptionInfo();
            GodSkillM.GetCaption(id, ref captionInfo);
            GodSkillInfo godSkillInfo = new GodSkillInfo();
            GodSkillM.GetGodSkill(captionInfo.m_godskilltype1, 1, ref godSkillInfo);
            iconInfo.mName = godSkillInfo.m_name;
            iconInfo.mID   = id;
        }
        iconInfo.mIsSoul = isSoul;
        iconInfo.mIsBook = isBook;
        return(iconInfo);
    }