public void SellPen() { InventoryManager.instance.money += animalPenBlueprint.GetSellAmount(); //add effect Destroy(animalPen); animalPenBlueprint = null; }
//test below override //private GameObject penToBuild; //idea /* * void Start() * { * penToBuild = standardPenPrefab; * } * */ public void SelectPen(Node node) { if (selectedPen == node) { DeselectNode(); return; } selectedPen = node; penToBuild = null; nodeUI.SetTarget(node); }
/*void OnMouseDown () * { * if (EventSystem.current.IsPointerOverGameObject()) * return; * * if (animalPen != null) * { * buildManager.SelectPen(this); * Debug.Log("cant build here - to do display on screen"); * * return; * } * if (!buildManager.CanBuild) * return; * //current script below removed for test * BuildAnimalPen(buildManager.GetPenToBuild()); * * //build animalpen * //GameObject penToBuild = BuildManager.instance.GetPenToBuild(); * // animalPen = (GameObject)Instantiate(penToBuild, transform.position + positionOffset, transform.rotation); * }*/ public GameObject BuildAnimalPen(AnimalPenBlueprint blueprint) { if (InventoryManager.instance.money < blueprint.cost) { Debug.Log("you poor"); return(null); } FindObjectOfType <AudioManager>().Play("Pen"); InventoryManager.instance.money -= blueprint.cost; GameObject _pen = (GameObject)Instantiate(penPrefab, GetBuildPosition(), Quaternion.identity); animalPen = _pen; animalPenBlueprint = blueprint; penLevel = 0; //add effect penPurchasing.HidePossiblePens(); Debug.Log("pen has built"); return(_pen); }
public void SelectAnimalPenToBuild(AnimalPenBlueprint animalPen) { penToBuild = animalPen; DeselectNode(); }