void Start() { growthScript = GetComponent <VineGrowth>(); firstAnchor = transform.GetChild(1).GetComponent <AnchorHitDetection>(); lastAnchor = transform.GetChild(2).GetComponent <AnchorHitDetection>(); firstAnchor.gameObject.SetActive(false); lastAnchor.gameObject.SetActive(false); }
void GrowVine() { if (CurrentVines != null) { if (CurrentVines.Count > vineMax) { CurrentVines[0].GetComponent <VineGrowth>().DestroyVine(); } } currentVine = (Transform)Instantiate(vineBase, new Vector3(transform.position.x, transform.position.y - vineBaseOffset, transform.position.z), Quaternion.identity); currentVine.parent = vineParent; vineScript = currentVine.GetComponent <VineGrowth>(); vineScript.playerVine = this; vineScript.Player = transform; growingVine = true; }
private void Awake() { _vine = GetComponent <VineGrowth>(); }