Beispiel #1
0
 /// <summary>
 /// 显示大蓝瓶的数量
 /// </summary>
 /// <param name="kv"></param>
 private void DisplayBigBlueNum(KeyValueUpdate kv)
 {
     if (kv.Key.Equals("BigBlueBottleNum"))
     {
         textBigBlueItemCount.text = kv.Value.ToString();
         if (PlayerPackageDataProxy.GetInstance().GetCurrentBigBlueNum() == 0)
         {
             goBigBlueItemCount.gameObject.SetActive(false);
         }
     }
 }
Beispiel #2
0
 /// <summary>
 /// 显示小蓝瓶的数量
 /// </summary>
 /// <param name="kv"></param>
 private void DisplayLittleBlueNum(KeyValueUpdate kv)
 {
     if (kv.Key.Equals("LittleBlueBottleNum"))
     {
         //Debug.Log("改变文本");
         textLittleBlueItemCount.text = kv.Value.ToString();
         if (PlayerPackageDataProxy.GetInstance().GetCurrentLittleBlueNum() == 0)
         {
             goLittleBlueItemCount.gameObject.SetActive(false);
         }
     }
 }
 /// <summary>
 /// 使用大红瓶
 /// </summary>
 /// <param name="go"></param>
 private void OnBigRedBottleClick(GameObject go)
 {
     if (go != null)
     {
         if (PlayerPackageDataProxy.GetInstance().GetCurrentBigRedNum() >= 1)
         {
             PlayerKernalDataProxy.GetInstance().IncreaseHealthValues(item.Value);
             PlayerPackageDataProxy.GetInstance().DecreaseBigRedNum(1);
         }
         else
         {
             //全部消耗完毕后将物体移出小方格并且隐藏
             this.transform.SetParent(recoverItem);
             this.gameObject.SetActive(false);
         }
     }
 }
 /// <summary>
 /// 使用小蓝瓶
 /// </summary>
 /// <param name="go"></param>
 private void OnLittleBlueBottleClick(GameObject go)
 {
     if (go != null)
     {
         if (PlayerPackageDataProxy.GetInstance().GetCurrentLittleBlueNum() >= 1)
         {
             //Debug.Log("消耗小蓝瓶");
             PlayerPackageDataProxy.GetInstance().DecreaseLittleBlueNum(1);
             PlayerKernalDataProxy.GetInstance().IncreaseMagicValues(item.Value);
         }
         else
         {
             //全部消耗完毕后将物体移出小方格并且隐藏
             this.transform.SetParent(recoverItem);
             this.gameObject.SetActive(false);
         }
     }
 }