void PlaceVine() { GameObject newVine = (GameObject)Instantiate (vinePrefab, CalcPos (), Quaternion.identity); vineGen = newVine.GetComponent<vineGenerator> (); vineGen.player = transform; currentVine = newVine.transform; transform.position = new Vector3 (currentVine.position.x, transform.position.y, currentVine.position.z); currentVineUI.gameObject.SetActive(true); // print ("placing"); vineRemainingSlider.maxValue = vineGen.sections; persInv.vineCount--; vineActive = true; if (Application.loadedLevel == 4) { } }
void EndVine() { vineGen.sections = 0; vineGen = null; currentVineUI.gameObject.SetActive(false); if (currentVineUI.gameObject.activeSelf) { currentVineUI.gameObject.SetActive(false); } currentVine = null; vineActive = false; }