コード例 #1
0
    void SkillBuyPopUpCreate(int index)
    {
        TempStaticMemory.GamePause();
        AllPopupDisable();

        Debug.Log(index + "   index Test");

        ready_unlock_skillIndex = index;

        switch (ready_unlock_skillIndex)
        {
        case 1:
            DarkSkillPopup.SetActive(true);
            break;

        case 2:
            DeathSkillPopup.SetActive(true);

            break;

        case 3:
            LegendSkillPopup.SetActive(true);

            break;
        }
        UIEventListener.Get(buyButton).onClick += new UIEventListener.VoidDelegate(UnLockButtonProcess);
    }
コード例 #2
0
    private void UnLockButtonProcess(GameObject go)
    {
        int price = GM.getPrice("Skill");

        switch (ready_unlock_skillIndex)
        {
        case 1:

            if (TempStaticMemory.gold >= price)
            {
                GameDataBase.getDBinstance.getUserDB.PlayerSkillBuy('d');
                TempStaticMemory.gold -= price;
                btnController.SendMessage("SkillUnLock", 1, SendMessageOptions.DontRequireReceiver);
            }
            else
            {
                GM.SendToAlert(AlertDialog.NotGold, price.ToString("0"));
            }
            TempStaticMemory.GameResume();
            break;

        case 2:

            if (TempStaticMemory.gold >= price)
            {
                GameDataBase.getDBinstance.getUserDB.PlayerSkillBuy('D');
                TempStaticMemory.gold -= price;
                btnController.SendMessage("SkillUnLock", 2, SendMessageOptions.DontRequireReceiver);
            }
            else
            {
                GM.SendToAlert(AlertDialog.NotGold, price.ToString("0"));
            }
            break;

        case 3:
            LegendSkillPopup.SetActive(true);

            if (TempStaticMemory.gold >= price)
            {
                GameDataBase.getDBinstance.getUserDB.PlayerSkillBuy('l');
                AllPopupDisable();
                TempStaticMemory.gold -= price;

                btnController.SendMessage("SkillUnLock", 3, SendMessageOptions.DontRequireReceiver);
            }
            else
            {
                GM.SendToAlert(AlertDialog.NotGold, price.ToString("0"));
            }

            break;
        }
        AllPopupDisable();
        TempStaticMemory.GameResume();

        ready_unlock_skillIndex = -1;
        UIEventListener.Get(buyButton).onClick -= new UIEventListener.VoidDelegate(UnLockButtonProcess);

        this.gameObject.SetActive(false);
    }
コード例 #3
0
 void AllPopupDisable()
 {
     DarkSkillPopup.SetActive(false);
     DeathSkillPopup.SetActive(false);
     LegendSkillPopup.SetActive(false);
 }