Exemplo n.º 1
0
    public void SetItemData(ListItemUI listItemUI)
    {
        mListItemUI  = listItemUI;
        mTotalNum    = RichEngine.Instance.m_setting.m_LottryTypes[UIController.Instance.mLottryType].totalNum;
        mKeepNumbers = RichEngine.Instance.m_dataCenter.GetRecordOf(UIController.Instance.mLottryType).m_KeepNumbers;
        string num   = "";
        int    index = -1;
        int    row   = -1;

        foreach (var segment in RichEngine.Instance.m_setting.m_LottryTypes[UIController.Instance.mLottryType].segments)
        {
            row++;
            for (int i = 0; i < segment.count; i++)
            {
                index++;
                GameObject uiObject = UIController.Instance.CreateObject("UI/input_Keep", img_bg.gameObject);
                uiObject.transform.localPosition = new Vector3(200 + 80 * i, 300 - 80 * row, 0);
                uiObject.name = "input_" + index;
                //Debug.Log("localPosition" + uiObject.transform.localPosition);
                if (mKeepNumbers != null)
                {
                    num = mKeepNumbers[index].ToString();
                }
                uiObject.GetComponent <KeepItemUI>().SetItemData(index, num, this);
                if (i == segment.count - 1)
                {
                    string txtName  = "img_bg/txt_" + row;
                    Text   txt_rule = transform.Find(txtName).GetComponent <Text>();
                    txt_rule.text = "(" + segment.min + "-" + segment.max + ")";
                    txt_rule.transform.localPosition = new Vector3(300 + 80 * i, 300 - 80 * row, 0);
                }
            }
        }
    }
    private void addItem(RectTransform parent, ToggleGroup group, Sprite icon, string name, string one, string two, string three, UnityAction <Boolean> call, bool toggled = false)
    {
        ListItemUI item = Instantiate(listItem);

        item.transform.SetParent(parent, false);
        item.setData(name, icon, one, two, three);
        var toggle = item.GetComponent <Toggle>();

        toggle.group = group;
        toggle.isOn  = toggled;
        toggle.onValueChanged.AddListener(call);
    }
Exemplo n.º 3
0
 public void SetItemData(RichDataEntry data, ListItemUI listItem)
 {
     m_richDataEntry = data;
     mListItemUI     = listItem;
     if (data.m_RandNumbers == null)
     {
         txt_RandNumbers.text = "";
     }
     else
     {
         txt_RandNumbers.text = UIController.Instance.IntConvertString(data.m_RandNumbers);
     }
 }
Exemplo n.º 4
0
    public void SetItemData(RichDataEntry data, ListItemUI listItem)
    {
        m_richDataEntry = data;
        mListItemUI     = listItem;
        if (data.m_KeepNumbers == null)
        {
            txt_KeepNunbers.text = "";
        }
        else
        {
            txt_KeepNunbers.text = UIController.Instance.IntConvertString(data.m_KeepNumbers);
        }

        if (data.m_RandNumbers == null)
        {
            txt_RandNumbers.text = "";
        }
        else
        {
            txt_RandNumbers.text = UIController.Instance.IntConvertString(data.m_RandNumbers);
        }

        txt_LotteryType.text = "请帮我购买" + UIController.Instance.mLottryType;
    }