コード例 #1
0
 void OnUpdateGatheEvent(COM_Gather g)
 {
     if (g.gatherId_ == Data._Id)
     {
         //Data = Data;
     }
 }
コード例 #2
0
    /// <summary>
    /// ²É¼¯°´Å¥°´ÏÂ
    /// </summary>
    public void OnOneBtn(ButtonScript obj, object args, int param1, int param2)
    {
        GatherData gd      = GatherData.GetGather(_GatherId);
        COM_Gather gatherD = GatherSystem.instance.GetOpenGather(_GatherId);
        int        maxNum  = 0;

        GlobalValue.Get(Constant.C_GatherNumMax, out maxNum);
        if (gatherD != null)
        {
            if (gatherD.num_ >= maxNum)
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("EN_GatherTimesLess"));
                return;
            }
        }

        //if(BagSystem.instance.BagIsFull())
        //{
        //	PopText.Instance.Show(LanguageManager.instance.GetValue("bagfull"));
        //	return;
        //}
        if (_GatherId == 0)
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("qingxuanzhecaiji"));
            return;
        }
        //GatherData gd = GatherData.GetGather(_GatherId);
        GatherSystem.instance.Gather(_GatherId, 1);
    }
コード例 #3
0
    public void AddOpenGather(COM_Gather gather)
    {
        for (int i = 0; i < OpenGatherItemList.Count; i++)
        {
            if (OpenGatherItemList[i].gatherId_ == gather.gatherId_)
            {
                OpenGatherItemList[i] = gather;
                GatherData gd = GatherData.GetGather((int)gather.gatherId_);
                if (gd != null && gd._Level >= 40)
                {
                    PopText.Instance.Show(LanguageManager.instance.GetValue("useopenGatherbook").Replace("{n}", gd._Title));
                }
                return;
            }
        }

        if (!OpenGatherItemList.Contains(gather))
        {
            OpenGatherItemList.Add(gather);
            GatherData gd = GatherData.GetGather((int)gather.gatherId_);
            if (gd != null && gd._Level >= 40)
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("useopenGatherbook").Replace("{n}", gd._Title));
            }
        }



        if (UpdateGatheEvent != null)
        {
            UpdateGatheEvent(gather);
        }
    }
コード例 #4
0
    private void OnTenBtn(ButtonScript obj, object args, int param1, int param2)
    {
        if (_GatherId == 0)
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("qingxuanzhecaiji"));
            return;
        }
        GatherData gd      = GatherData.GetGather(_GatherId);
        COM_Gather gatherD = GatherSystem.instance.GetOpenGather(_GatherId);

        int maxNum = 0;

        GlobalValue.Get(Constant.C_GatherNumMax, out maxNum);
        if (gatherD != null)
        {
            if (maxNum - gatherD.num_ < 10)
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("gathertennoNum"));
                return;
            }
            if (gatherD.num_ >= maxNum)
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("EN_GatherTimesLess"));
                return;
            }
        }


        int tenMoney = 0;

        if (gatherD == null)
        {
            for (int i = 1; i <= 10; i++)
            {
                tenMoney += (0 + i - 1) / 5 * gd._AddMoney + gd._Money;
            }
        }
        else
        {
            for (int i = 1; i <= 10; i++)
            {
                tenMoney += ((int)gatherD.num_ + i - 1) / 5 * gd._AddMoney + gd._Money;
            }
        }
        if (tenMoney > GamePlayer.Instance.GetIprop(PropertyType.PT_Money))
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("nomoney"), PopText.WarningType.WT_Tip);
            return;
        }
        MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("chouxiaohanjq").Replace("{n}", tenMoney.ToString()), () => { GatherSystem.instance.Gather(_GatherId, 10); });
    }
コード例 #5
0
    void _SelectKind(GameObject obj, int id)
    {
        for (int i = 0; i < _KindItemSize; ++i)
        {
            if (_KindItems[i].gameObject == obj)
            {
                _KindItems[i]._Selected.Show();
            }
            else
            {
                _KindItems[i]._Selected.Hide();
            }
        }
        _GatherId = id;
        GatherData gd      = GatherData.GetGather(_GatherId);
        COM_Gather gatherD = GatherSystem.instance.GetOpenGather(_GatherId);
        int        maxNum  = 0;

        GlobalValue.Get(Constant.C_GatherNumMax, out maxNum);
        if (gatherD == null)
        {
            if (gd._Level <= GamePlayer.Instance.GetIprop(PropertyType.PT_Level))
            {
                gatherNunLab.gameObject.SetActive(true);
                gatherNunLab.text = LanguageManager.instance.GetValue("gatherCanNum").Replace("{n}", (maxNum - GatherSystem.instance.maxNum).ToString() + "/" + maxNum);
            }
            else
            {
                gatherNunLab.gameObject.SetActive(false);
            }
        }
        else
        {
            gatherNunLab.gameObject.SetActive(true);
            gatherNunLab.text = LanguageManager.instance.GetValue("gatherCanNum").Replace("{n}", (maxNum - GatherSystem.instance.maxNum).ToString() + "/" + maxNum);
        }


        if (gatherD == null)
        {
            oneNeedMoneyLab.text = (((int)(0 + 1 - 1)) / 5 * gd._AddMoney + gd._Money).ToString();
            int tenMoney = 0;
            for (int i = 1; i <= 10; i++)
            {
                tenMoney += (0 + i - 1) / 5 * gd._AddMoney + gd._Money;
            }

            tenNeedMoneyLab.text = tenMoney.ToString();
        }
        else
        {
            oneNeedMoneyLab.text = (((int)gatherD.num_ + 1 - 1) / 5 * gd._AddMoney + gd._Money).ToString();
            int tenMoney1 = 0;
            for (int i = 1; i <= 10; i++)
            {
                tenMoney1 += ((int)gatherD.num_ + i - 1) / 5 * gd._AddMoney + gd._Money;
            }

            //for (size_t i = 0; i < times; ++i)
            //{
            //	needmoney += (pnewdate->num_+i -1)/5*pG->addmoney_+pG->money_;
            //}


            tenNeedMoneyLab.text = tenMoney1.ToString();
        }
        //
    }
コード例 #6
0
    void UpdateItemList(List <COM_DropItem> items)
    {
        _ItemList.transform.DetachChildren();
        foreach (GatherItemCell gkc in _Items)
        {
            gkc.gameObject.SetActive(false);
            //GameObject.Destroy(gkc.gameObject);
        }
        //_KindItems.Clear();

        _ItemSize = 0;
        foreach (var g in items)
        {
            GatherItemCell gkc = null;
            if (_ItemSize >= _Items.Count)
            {
                gkc = GameObject.Instantiate(_ItemCellTmplate) as GatherItemCell;
                gkc.transform.localScale = Vector3.one;

                _Items.Add(gkc);
            }
            else
            {
                gkc = _Items[_ItemSize];
            }

            gkc.Data = g;
            _ItemList.AddChild(gkc.transform);
            gkc.gameObject.SetActive(true);
            gkc.transform.localScale = Vector3.one;
            ++_ItemSize;
        }

        _ItemList.Reposition();

        GatherData gd      = GatherData.GetGather(_GatherId);
        COM_Gather gatherD = GatherSystem.instance.GetOpenGather(_GatherId);
        int        maxNum  = 0;

        GlobalValue.Get(Constant.C_GatherNumMax, out maxNum);
        if (gatherD == null)
        {
            gatherNunLab.gameObject.SetActive(true);
            gatherNunLab.text = LanguageManager.instance.GetValue("gatherCanNum").Replace("{n}", (maxNum - GatherSystem.instance.maxNum).ToString() + "/" + maxNum);
        }
        else
        {
            gatherNunLab.text = LanguageManager.instance.GetValue("gatherCanNum").Replace("{n}", (maxNum - GatherSystem.instance.maxNum).ToString() + "/" + maxNum);
        }
        if (gatherD == null)
        {
            oneNeedMoneyLab.text = (((int)(0 + 1 - 1)) / 5 * gd._AddMoney + gd._Money).ToString();
            int tenMoney = 0;
            for (int i = 1; i <= 10; i++)
            {
                tenMoney += ((int)(0 + i - 1)) / 5 * gd._AddMoney + gd._Money;
            }

            tenNeedMoneyLab.text = tenMoney.ToString();
        }
        else
        {
            oneNeedMoneyLab.text = (((int)gatherD.num_ + 1 - 1) / 5 * gd._AddMoney + gd._Money).ToString();
            int tenMoney1 = 0;
            for (int i = 1; i <= 10; i++)
            {
                tenMoney1 += ((int)gatherD.num_ + i - 1) / 5 * gd._AddMoney + gd._Money;
            }

            tenNeedMoneyLab.text = tenMoney1.ToString();
        }


        //FlashGatherTimes (_mineType);
    }