Пример #1
0
 //初始化抽奖方式信息
 private void initDrawWays()
 {
     DrawWaySample[] samples = LuckyDrawSampleManager.Instance.getLuckyDrawSampleBySid(sid).ways;
     ways = new DrawWay[samples.Length];
     for (int i = 0; i < ways.Length; i++)
     {
         ways [i] = new DrawWay(samples [i]);
     }
 }
Пример #2
0
    /** 限时抽奖活动 */
    public void luckyDrawByNotice(int times, int sid, int wayIndex, int noticeSid, DrawWay way, CallBackLuckyDrawResults callback)
    {
        drawWay       = way;
        this.callback = callback;
        ErlKVMessage message = new ErlKVMessage(FrontPort.LUCKY_DRAW);

        message.addValue("times", new ErlInt(times));         //次数
        message.addValue("ldid", new ErlInt(sid));            //抽奖条目id
        message.addValue("choose", new ErlInt(wayIndex));     //抽奖方式id
        message.addValue("noticeSid", new ErlInt(noticeSid)); //活动sid
        access(message);
    }
Пример #3
0
    public void luckyDraw(int times, int sid, int wayIndex, DrawWay way, CallBackLuckyDrawResults callback)
    {
        drawWay       = way;
        this.callback = callback;
        ErlKVMessage message = new ErlKVMessage(FrontPort.LUCKY_DRAW);

        message.addValue("times", new ErlInt(times));       //次数
        message.addValue("ldid", new ErlInt(sid));          //抽奖条目id
        message.addValue("choose", new ErlInt(wayIndex));   //抽奖方式id
        access(message);
        if (GuideManager.Instance.isEqualStep(7004000))
        {
            GuideManager.Instance.doGuide();
        }
    }
Пример #4
0
 //检查玩家的星星数是否达到消费数量
 private bool isDraw(DrawWay ways)
 {
     if (UserManager.Instance.self.starSum >= ways.getCostPrice(lucky.getFreeNum()))
     {
         return(true);
     }
     else
     {
         if (isSend)
         {
             if (UserManager.Instance.self.starSum >= (lucky.ways [0].getCostPrice(lucky.getFreeNum()) * drawTimes))
             {
                 return(true);
             }
         }
         MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("s0377"));
         return(false);
     }
 }
Пример #5
0
    //设置花费图标静态方法
    public static void setToolCostIconName(DrawWay way, UISprite icon)
    {
        switch (way.getCostType())
        {
        case PrizeType.PRIZE_MONEY:
            icon.spriteName = "title_money";
            break;

        case PrizeType.PRIZE_RMB:
            icon.spriteName = "rmb";
            break;

        case PrizeType.PRIZE_PROP:
            switch (PropSampleManager.Instance.getPropSampleBySid(way.getCostToolSid()).iconId)
            {
            case 1:
                icon.spriteName = "goldCoin";
                break;

            case 2:
                icon.spriteName = "ptCoin";
                break;

            case 3:
                icon.spriteName = "activityCoin";
                break;

            case 4:
                icon.spriteName = "ptCoin";
                break;

            case 5:
                icon.spriteName = "sliverCoin";
                break;
            }
            break;
        }
    }