public void GetAttributesFromAllComponents() { towerBody = this.transform.parent.parent.parent.gameObject.GetComponentInChildren <TowerBody> (); towerBase = this.transform.parent.parent.parent.parent.gameObject.GetComponentInChildren <Effector> (); towerProjectile = this.transform.parent.parent.parent.parent.gameObject.GetComponentInChildren <ProjectilePile> ().projectile; baseEffector = towerBase.GetComponent <Effector> (); maxAngle = towerBody.angle; maxRange = towerBody.range; Mesh mesh = GetComponent <MeshFilter> ().mesh; mesh.Clear(); mesh.vertices = AssignVerticesForWedge(); mesh.triangles = AssignTrianglesForWedge(); mesh.RecalculateNormals(); mesh.RecalculateBounds(); GetComponent <MeshCollider> ().sharedMesh = mesh; }