Exemplo n.º 1
0
 public void BuyItem()
 {
     if (GlobalValue.instance.gold >= itemAttribute[index].SellValue)
     {
         GlobalValue.instance.gold -= itemAttribute[index].SellValue;
         ItemAPI.AddItem(itemAttribute[index].itemID);
         print("新增道具 名稱:" + (itemAttribute[index].itemName));
         itemSold[index].SetActive(true);
         ItemHolder.instance.storeCount[index] = true;
     }
     else
     {
         Instantiate(NoFoodAnim, Holder.transform);
     }
 }
Exemplo n.º 2
0
    void Reward(int id)
    {
        if (!ontime)
        {
            ontime = true;
            ComfirmPanel.SetActive(true);
            GlobalValue.instance.daliyBonus = true;

            if (BonusItems[id].rewardType == 2)
            {
                ItemAPI.AddItem(BonusItems[id].itemNumber);
            }
            else if (BonusItems[id].rewardType == 1)
            {
                GlobalValue.instance.exp += BonusItems[id].itemNumber;
            }
            else if (BonusItems[id].rewardType == 0)
            {
                GlobalValue.instance.gold += BonusItems[id].itemNumber;
            }
        }
    }
Exemplo n.º 3
0
    public void TestMode_(int index)
    {
        Scene scene = SceneManager.GetActiveScene();

        switch (index)
        {
        case 0:
            GlobalValue.instance.enegy = 50;
            break;

        case 1:
            GlobalValue.instance.exp += 100000;
            break;

        case 2:
            GlobalValue.instance.gold += 100000;
            break;

        case 3:
            scene = SceneManager.GetActiveScene();
            if (scene.name == "GameScene")
            {
                PlayerControll.instance.playerNowHp = PlayerControll.instance.playerMaxHp;
            }
            break;

        case 4:
            scene = SceneManager.GetActiveScene();
            if (scene.name == "GameScene")
            {
                PlayerControll.instance.playerNowEP = 20;
            }
            break;

        case 5:
            if (ItemHolder.instance.amount <= 0)
            {
                for (int i = 0; i < ItemHolder.instance.globleItems.Count; i++)
                {
                    ItemAPI.AddItem(1000 + i);
                }
            }
            break;

        case 6:
            scene = SceneManager.GetActiveScene();
            if (scene.name == "GameScene")
            {
                TurnControll.instance.SpawnSpecialFood();
            }
            break;

        case 7:
            GlobalValue.instance.mission[0] = true;
            for (int i = 0; i < 5; i++)
            {
                GlobalValue.instance.level[i] = true;
            }
            GlobalValue.instance.SaveAllData();
            break;

        case 8:
            Reset();
            break;
        }
    }
Exemplo n.º 4
0
 public void AddItem()
 {
     ItemAPI.AddItem(1000);
 }