Beispiel #1
0
    public override void read(ErlKVMessage message)
    {
        Dictionary <int, int> map = new Dictionary <int, int>();
        ErlArray array            = message.getValue("msg") as ErlArray;

        if (array != null)
        {
            for (int i = 0; i < array.Value.Length; i += 2)
            {
                int sid = StringKit.toInt(array.Value[i].getValueString());
                int num = StringKit.toInt(array.Value[i + 1].getValueString());
                map.Add(sid, num);
            }
        }

        List <ArenaAwardSample> samples = ArenaAwardSampleManager.Instance.getSamplesByType(ArenaAwardWindow.TYPE_GUESS);
        List <ArenaAwardInfo>   infos   = new List <ArenaAwardInfo>();

        foreach (ArenaAwardSample sample in samples)
        {
            ArenaAwardInfo info = new ArenaAwardInfo();
            info.sample    = sample;
            info.condition = map[sample.condition];
            infos.Add(info);
        }
        if (callback != null)
        {
            callback(infos);
        }
    }
    public override void read(ErlKVMessage message)
    {
        int        myIntegeral = 0;
        List <int> sids        = new List <int>();
        ErlArray   array       = message.getValue("msg") as ErlArray;

        if (array != null)
        {
            myIntegeral = StringKit.toInt(array.Value[0].getValueString());
            array       = array.Value[1] as ErlArray;
            if (array != null)
            {
                for (int i = 0; i < array.Value.Length; i++)
                {
                    int sid = StringKit.toInt(array.Value[i].getValueString());
                    sids.Add(sid);
                }
            }
        }
        ArenaManager.instance.finalMyIntergal = myIntegeral;

        List <ArenaAwardSample> samples = ArenaAwardSampleManager.Instance.getSamplesByType(ArenaAwardWindow.TYPE_INTEGRAL);

        ArenaAwardManager.Instance.integralAwardInfos.Clear();
        foreach (ArenaAwardSample sample in samples)
        {
            ArenaAwardInfo info = new ArenaAwardInfo();
            info.sample    = sample;
            info.condition = myIntegeral;

            for (int i = 0; i < sids.Count; i++)
            {
                if (sids[i] == sample.sid)
                {
                    info.received = true;
                    break;
                }
            }

            ArenaAwardManager.Instance.integralAwardInfos.Add(info);
        }
        if (callback != null)
        {
            callback(ArenaAwardManager.Instance.integralAwardInfos);
            callback = null;
        }
    }
Beispiel #3
0
    /// <summary>
    /// 当前档的积分奖励是否可以领取
    /// </summary>
    public bool isCanGetIntegralAward()
    {
        ArenaAwardInfo info = getCurrentIntegralAwardInfo();

        if (info == null)
        {
            return(false);
        }
        if (info.condition >= info.sample.condition && !info.received)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
    public override void read(ErlKVMessage message)
    {
        List <ArenaAwardSample> samples = ArenaAwardSampleManager.Instance.getSamplesByType(ArenaAwardWindow.TYPE_FINAL);
        List <ArenaAwardInfo>   infos   = new List <ArenaAwardInfo>();

        ArenaAwardSample sample;

        for (int i = samples.Count - 1; i >= 0; i--)
        {
            sample = samples[i];
            ArenaAwardInfo info = new ArenaAwardInfo();
            info.sample = sample;
            infos.Add(info);
        }
        ErlType type = message.getValue("msg") as ErlType;
        bool    flag = type.getValueString() == "1";

        if (callback != null)
        {
            callback(infos, flag);
        }
    }
Beispiel #5
0
    public void init(ArenaAwardInfo info)
    {
        this.info = info;
        bool canReceived = false;

        lblCondition.text = "";
        completedIcon.SetActive(false);
        bg01.gameObject.SetActive(false);
//		bg02.gameObject.SetActive (false);
        firstAwardLogo.gameObject.SetActive(false);
        title.gameObject.SetActive(false);
        /** 决赛奖励 */
        if (info.sample.type == ArenaAwardWindow.TYPE_FINAL)
        {
            lblName.text                    = "[FFF0C1]" + info.sample.name;
            lblName.effectStyle             = UILabel.Effect.Outline;
            lblName.effectColor             = new Color(33f / 255, 59f / 255, 87f / 255);
            lblName.transform.localPosition = new Vector3(0, 86, 0);
            buttonConfirm.gameObject.SetActive(false);
            if (info.sample.type == ArenaAwardSample.TYPE_FINAL)
            {
                if (info.sample.condition == ArenaAwardSample.CONDITION_TYPE)
                {
//					bg00.spriteName = "img_7";
//					bg02.gameObject.SetActive(true);
                    firstAwardLogo.gameObject.SetActive(true);
                    lblName.gameObject.SetActive(true);
                    title.gameObject.SetActive(false);
                    lblName.gameObject.SetActive(false);
                }
                else
                {
                    firstAwardLogo.gameObject.SetActive(false);
                    title.gameObject.SetActive(true);
                    lblName.gameObject.SetActive(true);
                    lblName.gameObject.transform.localPosition = new Vector3(0, lblName.gameObject.transform.localPosition.y, lblName.gameObject.transform.localPosition.z);
                }
            }
        }
        /** 竞猜奖励 */
        else if (info.sample.type == ArenaAwardWindow.TYPE_GUESS)
        {
            lblName.transform.localPosition = new Vector3(0, 60, 0);
            lblName.text = "[A93D12]" + info.sample.name + "[-]";
            content.transform.localPosition       = new Vector3(-196, -25, -300);
            buttonConfirm.transform.localPosition = new Vector3(180, -20, 0);
            bg01.gameObject.SetActive(true);
            canReceived       = info.condition > 0;
            lblCondition.text = LanguageConfigManager.Instance.getLanguage("Arena33", info.condition.ToString());
        }
        /** 积分奖励 */
        else
        {
            lblName.transform.localPosition = new Vector3(-27, 0, 0);
            lblName.text = "[6E473D]" + info.sample.name + "[-]";
            content.transform.localPosition       = new Vector3(-196, -5, -300);
            buttonConfirm.transform.localPosition = new Vector3(180, -5, 0);
            completedIcon.SetActive(info.received);
            buttonConfirm.gameObject.SetActive(!info.received);
            canReceived = info.condition >= info.sample.condition;
        }

        if (canReceived && !info.received)
        {
            buttonConfirm.disableButton(false);
        }
        else
        {
            buttonConfirm.disableButton(true);
        }

        int pos = 0;

        Utils.DestoryChilds(content.gameObject);
        for (int i = 0; i < info.sample.prizes.Length; i++)
        {
            PrizeSample ps = info.sample.prizes[i];
//            if(ps.type != PrizeType.PRIZE_CARD)
//            {
            GameObject obj = NGUITools.AddChild(content.gameObject, window.goodsViewPrefab);
            GoodsView  sc  = obj.GetComponent <GoodsView>();
            sc.init(ps);
            sc.fatherWindow             = window;
            obj.transform.localScale    = new Vector3(0.95f, 0.95f, 1);
            obj.transform.localPosition = new Vector3(pos * 110 - 20, 0, 0);
            pos++;
//            }
        }
    }