public void startTreePlant(HelperPlantType type) { if (treeToUnlockFlower.ContainsKey(type) && !needToUnlock.ContainsKey(type)) { needToUnlock[treeToUnlockFlower[type]] = true; } }
public void finishTree(HelperPlantType treeType) { var value = Dialogues.FinishFirstTree; if (!hadDialog.ContainsKey(value)) { hadDialog[value] = true; TutorialPanel.Instance.Init(value); } }
public void canPurchasePlant(HelperPlantType type) { if (TutorialPanel.Instance.canGeneratePanel() && enoughResourceToStartDialog.ContainsKey(type)) { var value = enoughResourceToStartDialog[type]; if (!hadDialog.ContainsKey(value)) { hadDialog[value] = true; TutorialPanel.Instance.Init(value); } } }
public void UpdateInfo(HelperPlantType treeType) { if (!plantManager || !plantManager.plantName.ContainsKey(treeType)) { return; } levelInfoText.text = "This is a " + plantManager.plantName[treeType]; levelInfoText.text += "\n"; levelInfoText.text += plantManager.levelDetail[treeType]; }
public bool IsPlantable(HelperPlantType type, Collider2D pos, bool isWaterPlant = false) { if (!ignoreResourcePlant) { var prodDictionary = helperPlantCost[type]; foreach (var pair in prodDictionary) { if (currentResource[pair.Key] < pair.Value) { return(false); } } } return(IsPositionValid(pos, isWaterPlant)); }
public bool IsPlantable(HelperPlantType type, bool ignoreSlot = false) { if (!ignoreResourcePlant) { var prodDictionary = helperPlantCost[type]; foreach (var pair in prodDictionary) { if (currentResource[pair.Key] < pair.Value) { return(false); } } } return(ignoreSlot || hasSlot()); }
public void startTreePlant(HelperPlantType type) { if (treeToUnlockFlower.ContainsKey(type)) { UnlockPlant(treeToUnlockFlower[type]); } if (helperPlantProd.ContainsKey(type)) { foreach (var product in helperPlantProd[type].Keys) { UnlockResource(product); } } TutorialManager.Instance.finishPlant(type); }
public void finishPlant(HelperPlantType type) { if (finishPlantToStartDialog.ContainsKey(type)) { var value = finishPlantToStartDialog[type]; if (!hadDialog.ContainsKey(value)) { hadDialog[value] = true; if (type == HelperPlantType.appleTree2 || type == HelperPlantType.appleTree4) { StartCoroutine(waitShow(2, value)); } else { TutorialPanel.Instance.Init(value); } } } }
public void finishTree(HelperPlantType treeType) { foreach (Transform slot in gardenSlots) { if (slot.GetComponent <GardenSlot>().tree.GetComponent <MainTree>().upgradeList[0] == treeType) { foreach (Transform child in slot.GetComponent <GardenSlot>().allInTreeNode) { Destroy(child.gameObject); } //List<Transform> allPlants = new List<Transform>(); foreach (Transform tt in PlantsManager.Instance.allInTreeGame) { var go = Instantiate(tt.gameObject); var t = go.transform; var localP = t.localPosition; t.SetParent(slot.GetComponent <GardenSlot>().allInTreeNode); t.localPosition = localP; foreach (Transform c in t) { foreach (Transform c2 in c) { foreach (Transform c3 in c2) { //foreach (Transform c4 in c) { if (c3.GetComponent <HelperInsect>()) { Destroy(c3.gameObject); } } } } } t.GetComponent <HelperPlant>().MoveToGarden(); } } } }
public void showLevelInfo(HelperPlantType type) { levelInfoPanel.SetActive(true); levelInfoPanel.GetComponent <LevelInfo>().UpdateInfo(type); }
// Start is called before the first frame update void Start() { finishedTreeType = tree.GetComponent <MainTree>().finishType; }
public void UnlockPlant(HelperPlantType type) { isPlantUnlocked[type] = true; HUD.Instance.UpdatePlantButtons(); }
public void ReduceCostForType(HelperPlantType type) { ReduceResource(currentResource, helperPlantCost[type]); // PlantsManager.Instance.UpdateRate(); }