public void triggerDraw(SaveLoad.Solutions sol) { Debug.Log("trigeredDraw_Solution"); InventoryRef = GameObject.FindWithTag("Inventory"); if (InventoryRef == null) { Debug.Log("InventoryRef continua nulo"); } iconImage.sprite = InventoryRef.gameObject.GetComponent <SpriteRefs>().ListaSolutions[sol.icone];//]; So = sol; Invoke("DrawOnClick", 0);//teste }
// Start is called before the first frame update void Awake() { /* * ////////teste * for(int i=0; i < 4; i++) /////////////////////////////// ITENS * { * SaveLoad.Item tempItem = new SaveLoad.Item(); * tempItem.AMOUNT = 0; tempItem.ICONTYPEID = (i ); tempItem.ID = 0; * if (i == 0) * { * tempItem.NAME_PT = "Pedra de mão"; tempItem.NAME_EN = "Hand Stone"; * tempItem.DESCRIPTION_PT = "Pedras que cabem na mão, podem ser usadas para construir uma Solução."; * tempItem.DESCRIPTION_EN = "Stones that fits in the hand, can be used to build a Solution"; * tempItem.ISTACKABLE = true; * } * else if (i == 1) * { * tempItem.NAME_PT = "Pedra de Fina"; tempItem.NAME_EN = "Smooth Stone"; * tempItem.DESCRIPTION_PT = "Pedras que de tamanho pequeno, podem ser usadas para construir uma Solução."; * tempItem.DESCRIPTION_EN = "Very small and tiny stones, can be used to build a Solution"; * tempItem.ISTACKABLE = true; * } * else if (i == 2) * { * tempItem.NAME_PT = "Planta"; tempItem.NAME_EN = "Plant"; * tempItem.DESCRIPTION_PT = "Planta que pode ser usada para construir uma Solução."; * tempItem.DESCRIPTION_EN = "Plant that can be used to build a Solution"; * tempItem.ISTACKABLE = true; * } * else if (i == 3) * { * tempItem.NAME_PT = "Folhagem"; tempItem.NAME_EN = "Dry Leaves"; * tempItem.DESCRIPTION_PT = "Folhas secas que podem ser usadas para construir uma Solução."; * tempItem.DESCRIPTION_EN = "Dry leaves that can be used to build a Solution"; * tempItem.ISTACKABLE = true; * } * tempItem.TYPE = 1; * SaveLoad.inventoryData.Add(tempItem); * * }*/ for (int i = 0; i < 2; i++)/////////////////////////////// SOLUTIONS { SaveLoad.Solutions tempItem = new SaveLoad.Solutions(); if (i == 0) { tempItem.icone = 0; tempItem.NAME_PT = "Fossa Evapotranspiradora"; tempItem.NAME_EN = "Evapotranspiratory Tank"; tempItem.DESCRIPTION_PT = "Solução Fossa Evapotranspiradora pode ser construída com 5xPedras de Mão, 5xFolhagens, 4xPlantas, 15xPedras Finas."; tempItem.DESCRIPTION_EN = "Solution Evapotranspiratory Tank can be builden with 5xHand Stones, 5xDryLeaves, 4xPlants, 15xSmooth Stones."; } else if (i == 1) { tempItem.icone = 1; tempItem.NAME_PT = "Círculo de Bananeira"; tempItem.NAME_EN = "Banana Circle"; tempItem.DESCRIPTION_PT = "Solução Círculo de Bananeira pode ser construída com 5xPedras de Mão, 5xFolhagens, 4xPlantas, 15xPedras Finas."; tempItem.DESCRIPTION_EN = "Solution Banana Circle can be builden with 5xHand Stones, 5xDryLeaves, 4xPlants, 15xSmooth Stones."; } SaveLoad.solutionsData.Add(tempItem); } for (int i = 0; i < 1; i++)/////////////////////////////// QUESTS { SaveLoad.QuestID tempItem = new SaveLoad.QuestID(); if (i == 0) { tempItem.qProgress = SaveLoad.QuestID.questProgress.Started; tempItem.enumIndex = 1; tempItem.NAME_PT = "Purifique o rio!"; tempItem.NAME_EN = "Purify the river"; tempItem.DESCRIPTION_PT = "Implemente todas as 8 Soluções!"; tempItem.DESCRIPTION_EN = "Implement all the 8 Solutions!"; //Debug.Log("PAR"); } SaveLoad.questData.Add(tempItem); } /*TESTSaveLoad.AddItemOnInventory(0); SaveLoad.AddItemOnInventory(1); SaveLoad.AddItemOnInventory(2); SaveLoad.AddItemOnInventory(3); * /*/SelfUpdate(); }
public void completeQuest() { if (isDecreaseType) { foreach (SaveLoad.Item element in SaveLoad.inventoryData) { if (element.ID == decreseitemID) // tem item { if (element.AMOUNT >= qtdD) // quantidade do item é a requerida { for (int i = 0; i < qtdD; i++) { SaveLoad.RemoveItemOnInventory(decreseitemID); } } } } } if (isRewardType) { for (int i = 0; i < qtdR; i++) { SaveLoad.AddItemOnInventory(rewardItemID); } GameManager_Singleton.Instance.IconManager.showAnimReceiveReward(IconeQuest); } else if (isSolutionRewardType) { bool hassolution = false; foreach (SaveLoad.Solutions si in SaveLoad.solutionsData) { if (si.SolutionID_Class == questID) { hassolution = true; } } if (!hassolution) { SaveLoad.Solutions s = new SaveLoad.Solutions(); if (solutionTypeInstance == 0) { s.setDesc(SaveLoad.Solutions.solutionType.FossaVapotranspirante); } if (solutionTypeInstance == 1) { s.setDesc(SaveLoad.Solutions.solutionType.CirculoDeBananeira); } } } if (isCompletableQuest) { bool hasquest2 = false; foreach (SaveLoad.QuestID qid in SaveLoad.questData) { if (qid.QuestID_Class == questID) { hasquest2 = true; qid.qProgress = SaveLoad.QuestID.questProgress.Completed; } } if (!hasquest2) { Debug.Log("ERROR: Quest Not Found."); } } SaveLoad.Save(); }