예제 #1
0
    private void buttonClick(ButtonScript obj, object args, int param1, int param2)
    {
        Baby b = null;

        b = GamePlayer.Instance.GetBabyInst(param1);
        if (b != null)
        {
            if (BankSystem.instance.IsBabyStorageFull())
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("cankuman"));
                return;
            }
            if (b.isForBattle_)
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("chuzhan"));
                return;
            }
            if (b.GetInst().isShow_)
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("showbaby"));
                return;
            }

            StorageBabyCell bCell = obj.GetComponentInParent <StorageBabyCell> ();
            sDouble = false;
            StartCoroutine(DelayOnesortClick(bCell));
        }
    }
예제 #2
0
    private void OnClickCell(ButtonScript obj, object args, int param1, int param2)
    {
        BagCellUI bCell = obj.GetComponentInParent <BagCellUI> ();

        if (BankSystem.instance.IsStorageFull())
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("cankuman"));
            return;
        }
//		if(BagSystem.instance.BagIsFull())
//		{
//			PopText.Instance.Show(LanguageManager.instance.GetValue("bagfull"));
//			return;
//		}
        if (IsItemTypeIST_PVP((int)bCell.Item.itemId_))
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("IST_PVP"));
            return;
        }
//		if(!bCell.isLock)
//		{
//			MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("buyitemopenbag").Replace("{n}",ItemData.GetData(5001).name_),()=>{StoreUI.SwithShowMe();});
//			return;
//		}
//		if(bCell.Item == null)
//		{
//			return;
//		}

        bDouble = false;
        StartCoroutine(DelayOneClick(bCell));
    }
예제 #3
0
 private void OnClickBankCell(ButtonScript obj, object args, int param1, int param2)
 {
     if (param1 == 2)
     {
         return;
     }
     if (param1 == 1)
     {
         PopText.Instance.Show(LanguageManager.instance.GetValue("useStorePaper"));
     }
     else
     {
         BagCellUI bCell = obj.GetComponentInParent <BagCellUI> ();
         if (BagSystem.instance.BagIsFull())
         {
             PopText.Instance.Show(LanguageManager.instance.GetValue("bagfull"));
             return;
         }
         if (IsItemTypeIST_PVP((int)bCell.Item.itemId_))
         {
             PopText.Instance.Show(LanguageManager.instance.GetValue("IST_PVP"));
             return;
         }
         bDouble = false;
         StartCoroutine(DelayOneClick(bCell));
     }
 }
예제 #4
0
 private void OnClickCell(ButtonScript obj, object args, int param1, int param2)
 {
     if (param1 == 2)
     {
         return;
     }
     if (param1 == 1)
     {
         PopText.Instance.Show(LanguageManager.instance.GetValue("shoulian"));
     }
     else
     {
         bDouble = false;
         StorageBabyCell bCell = obj.GetComponentInParent <StorageBabyCell> ();
         babyId = (int)bCell.BabyInst.instId_;
         StartCoroutine(DelayOneClick(bCell));
     }
 }
예제 #5
0
 void OnClickReceive(ButtonScript obj, object args, int param1, int param2)
 {
     GuideManager.Instance.ProcEvent(ScriptGameEvent.SGE_AchievementReceived);
     if (SuccessSystem.isReceived(param1))
     {
         PopText.Instance.Show(LanguageManager.instance.GetValue("chengjiuWeiwangcheng"), PopText.WarningType.WT_Warning);
     }
     else
     {
         if (!BagSystem.instance.BagIsFull())
         {
             SuccessCell aCell = obj.GetComponentInParent <SuccessCell>();
             NetConnection.Instance.requestAchaward(param1);
             curCell = aCell;
         }
         else
         {
             PopText.Instance.Show(LanguageManager.instance.GetValue("EN_BagFull"));
         }
     }
 }
예제 #6
0
    private void OnClickCell(ButtonScript obj, object args, int param1, int param2)
    {
        if (GamePlayer.Instance.MagicItemLevel >= 30)
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("magictupomax"));
            return;
        }
        if (GamePlayer.Instance.MagicItemLevel >= GamePlayer.Instance.MagicTupoLevel)
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("qingtupo"));
            return;
        }

        if (GamePlayer.Instance.MagicItemLevel > GamePlayer.Instance.GetIprop(PropertyType.PT_Level))
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("bukeshengjilevel"));
            return;
        }

        BagCellUI bCell = obj.GetComponentInParent <BagCellUI> ();

        if (bCell.Item == null)
        {
            return;
        }


        if (expItems.Contains(bCell.Item.instId_))
        {
            obj.transform.Find("Sprite").gameObject.SetActive(false);
            expItems.Remove(bCell.Item.instId_);
        }
        else
        {
            obj.transform.Find("Sprite").gameObject.SetActive(true);
            expItems.Add(bCell.Item.instId_);
        }

        int addExp = 0;

        for (int i = 0; i < expItems.Count; i++)
        {
            addExp += ItemData.GetData((int)BagSystem.instance.GetItemByInstId((int)expItems[i]).itemId_).artifactExp_;
        }
        needMoneyLab.text = (addExp * 100).ToString();
        if (GamePlayer.Instance.GetIprop(PropertyType.PT_Money) < addExp * 100)
        {
            needMoneyLab.color = Color.red;
        }
        else
        {
            needMoneyLab.color = Color.gray;
        }
        if (addExp <= 0)
        {
            barLevelLab.gameObject.SetActive(true);
            barExpLab.gameObject.SetActive(true);
            magicItemLevelUp(GamePlayer.Instance.MagicItemLevel, addExp + GamePlayer.Instance.MagicItemExp);
            addlevelLab.text = "";
            addExpLab.text   = "";
        }
        else
        {
            barLevelLab.gameObject.SetActive(false);
            barExpLab.gameObject.SetActive(false);
            magicItemLevelUp(GamePlayer.Instance.MagicItemLevel, addExp + GamePlayer.Instance.MagicItemExp);
        }

        GuideManager.Instance.ProcEvent(ScriptGameEvent.SGE_MainMagicFirstClick);
    }