Beispiel #1
0
    public UIWidget NewCellsBox(GameObject parentObj)
    {
        UIWidget cellBox = null;

        if (_cellMgrWidget != null)
        {
            cellBox = NGUITools.AddChild(parentObj, _cellMgrWidget.gameObject).GetComponent <UIWidget>();
            // NGUITools.AddChild(parentObj, _cellMgrWidget.gameObject);
        }
        else
        {
            cellBox = NGUITools.AddWidget <UIWidget>(parentObj, 0);
        }

        cellBox.width  = _defaultWidth;
        cellBox.height = _defaultHeight;
        cellBox.name   = "CellBox" + cellBoxCount;

        //ComponentData data = cellBox.gameObject.AddComponent<ComponentData>();
        ComponentData data = ComponentData.Get(cellBox.gameObject);

        data.Id = cellBoxCount;
        cellBoxCount++;
        return(cellBox);
    }
Beispiel #2
0
    protected virtual void findObject()
    {
        _btnBack = FindGameObject(_rootPathName + "/button_back");

        _titleBg = FindGameObject(_rootPathName + "/titleBg");
        _titleLb = FindComponent <UILabel>(_rootPathName + "/titleBg/Label");
        _titleBg.SetActive(false);

        _listBg             = FindGameObject(_scrollPathName + "/content");
        _scrollView         = FindGameObject(_scrollPathName);
        _cellMgr            = FindGameObject(_scrollPathName + "/content").GetComponent <UIGridCellMgr>();
        _cellMgr.onShowItem = OnShowItem;

        _tabBg         = FindGameObject(_rootPathName + "/tab_bg");
        _tabCellPrefab = FindGameObject(_rootPathName + "/tabCell");
        _tabButtons    = new Transform[_tabNameList.Count];
        for (int i = 0; i < _tabNameList.Count; i++)
        {
            GameObject tabObj = NGUITools.AddChild(_tabBg, _tabCellPrefab);
            tabObj.SetActive(true);
            tabObj.transform.Find("Label").GetComponent <UILabel>().text = _tabNameList[i];
            ComponentData.Get(tabObj).Tag = i;
            _tabButtons[i] = tabObj.transform;
            UIEventListener.Get(tabObj).onClick = OnClickType;
        }
    }
Beispiel #3
0
    private void buyItem(GameObject go)
    {
        PrintNeed();
#if UNITY_EDITOR
        UtilTools.ShowMessage("PC版不提供充值服务", TextColor.RED);
        return;
#endif


        if (SDKManager.IsOfficialPay())
        {
            ComponentData componentdata = ComponentData.Get(go);
            int           payTag        = (int)componentdata.Tag;
            if (payTag == 1 && _ctrl.VX_recharge == false)              //微信支付先关闭
            {
                UtilTools.ShowMessage("微信支付通道暂时关闭", TextColor.RED);
                return;
            }
            if (payTag == 2 && _ctrl.ZFB_recharge == false)              //微信支付先关闭
            {
                UtilTools.ShowMessage("支付宝支付通道暂时关闭", TextColor.RED);
                return;
            }
            StartCoroutine("startAndroidOfficialPay", componentdata.Tag);
        }
        else
        {
            if (version.VersionData.IsReviewingVersion())
            {
                return;
            }
            else
            {
                ComponentData componentdata = ComponentData.Get(go);
                int           payTag        = (int)componentdata.Tag;
                if (payTag == 1 && _ctrl.VX_recharge == false)                  //微信支付先关闭
                {
                    UtilTools.ShowMessage("微信支付通道暂时关闭", TextColor.RED);
                    return;
                }
                if (payTag == 2 && _ctrl.ZFB_recharge == false)                  //微信支付先关闭
                {
                    UtilTools.ShowMessage("支付宝支付通道暂时关闭", TextColor.RED);
                    return;
                }
                GameObject sceneObj = GameObject.Find("Scene");
                if (sceneObj)
                {
                    StartUpScene startUpMono = sceneObj.GetComponent <StartUpScene>();
                    if (startUpMono != null)
                    {
                        startUpMono.startIOSWxPay(payTag, _nCost, _nCurKey, _sCurName, _sCurDes);
                    }
                }
            }
        }
    }
        internal TComponent Get <TComponent>(Entity <TScope> entity)
        {
#if !UNSAFE_ECS
            EnsureEntityExists(entity);
#endif
            TComponent component;

            ComponentData <TComponent> .Get(entity, out component);

            return(component);
        }
Beispiel #5
0
    public void OnClickType(GameObject sender)
    {
        UIButton button = sender.GetComponent <UIButton>();
        int      index  = ComponentData.Get(sender).Tag;

        if (_tabIndex == index)
        {
            _tabButtons[_tabIndex].GetComponent <UIToggle>().value = true;
            return;
        }

        UpdateTab(index);
    }
Beispiel #6
0
 static public int Get_s(IntPtr l)
 {
     try {
         UnityEngine.GameObject a1;
         checkType(l, 1, out a1);
         var ret = ComponentData.Get(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Beispiel #7
0
 public void ScrollCellToTop(GameObject cell, int animation = 1000)
 {
     ScrollCellToTop(ComponentData.Get(cell.transform.parent.gameObject).Id, animation);
 }