public void UpdateBag()
    {
        goodsItemList.RemoveChildrenToPool();

        foreach (var item in myBag.itemList)
        {
            if (item != null)
            {
                GButton gButton = goodsItemList.AddItemFromPool().asButton;
                gButton.GetChild("number").asTextField.text = item.itemHeld.ToString();
                gButton.GetChild("icon").asLoader.url       = UIPackage.GetItemURL("NewBagPackage", "goods" + item.Itemid);
                gButton.GetChild("id").asTextField.text     = item.Itemid.ToString();
                gButton.GetChild("title").asTextField.text  = item.itemInfo;
                gButton.onClick.Add(() => { ClickItem(gButton); });
            }
        }
        for (int i = 0; i < 30 - myBag.itemList.Count; i++)
        {
            GButton gButton = goodsItemList.AddItemFromPool().asButton;
            gButton.GetChild("number").asTextField.text = "";
            gButton.GetChild("icon").asLoader.url       = "";
            gButton.GetChild("id").asTextField.text     = "";
            gButton.GetChild("title").asTextField.text  = "";
            gButton.onClick.Add(() => { ClickItem(gButton); });
        }
        energyprogress1.TweenValue(energy1.num, 0.1f);
        energyprogress2.TweenValue(energy2.num, 0.1f);
        energyprogress3.TweenValue(energy3.num, 0.1f);
    }
Exemple #2
0
 //设置进度条完成的时间
 private void SetCompleteTime()
 {
     //将进度条归零
     progressBar.value = 0;
     //根据下拉框选择的值决定进度条完成的时间
     progressBar.TweenValue(100, Convert.ToInt32(comboBox.value));
 }
Exemple #3
0
    private GComboBox comboBox;                                 //可选下拉框

    // Start is called before the first frame update
    void Start()
    {
        mainUI      = GetComponent <UIPanel>().ui;
        progressBar = mainUI.GetChild("n0").asProgress;
        //设置进度条在5s内到达100
        progressBar.TweenValue(100, 5);
        comboBox = mainUI.GetChild("n7").asComboBox;
        //设置可选下拉框的改变的监听事件
        comboBox.onChanged.Add(SetCompleteTime);
    }
Exemple #4
0
        public static void CheckUpdate()
        {
            if (uiLoading == null)
            {
                UIPackage.AddPackage("Assets/BundleResources/UI/HotUpdate");
                uiLoading = (GComponent)UIPackage.CreateObject("HotUpdate", "UIHotUpdate");
                uiLoading.MakeFullScreen();
                GRoot.inst.AddChild(uiLoading);

                titleText  = (GTextField)uiLoading.GetChild("titleText");
                loadingBar = (GProgressBar)uiLoading.GetChild("progressBar");
            }

            titleText.text   = "Game Center";
            loadingBar.value = 0;
            loadingBar.TweenValue(100, 1).OnComplete(LoadingCompleteCallDelegate);
        }
Exemple #5
0
 // Update is called once per frame
 void Update()
 {
     Text.text = "x " + Global.HeroBlood;
     Abar.TweenValue(Global.HeroResistanceA, 1.0f);
     Bbar.TweenValue(Global.HeroResistanceB, 1.0f);
     Cbar.TweenValue(Global.HeroResistanceC, 1.0f);
     currentTime   += 0.1f;
     currentTimeTS += 0.1f;
     if (penti && currentTime > endTime)
     {
         mainUI.GetChild("n7").visible = false;
         penti = false;
     }
     if (ts && currentTimeTS > endTime)
     {
         mainUI.GetChild("n8").visible = false;
         tsText.visible = false;
         ts             = false;
     }
 }
Exemple #6
0
 private void EquationActEnd(string id)
 {
     ActProgress.TweenValue(0, 0.5f);
     isAct = false;
     Debug.Log("11");
 }
Exemple #7
0
 private void SetComboBoxChange()
 {
     progressBar.value = 0;
     progressBar.TweenValue(100, Convert.ToInt32(comboBox.value));
 }