float AgeGroup(Transform parent, float yMax) { ageGroup = GroupInfo(parent, "연령대", yMax); yMax -= titleHeight; for (int i = 0; i < 7; i++) { string text = "선택 안 함"; if (i == 1) { text = "20대 미만"; } if (i == 2) { text = "20대"; } if (i == 3) { text = "30대"; } if (i == 4) { text = "40대"; } if (i == 5) { text = "50대"; } if (i == 6) { text = "60대 이상"; } ToggleInfo toggleInfo = Toggle(parent, text); toggleInfo.toggleGroup = ageGroup; toggleInfo.id = i; RectTransform rectTransform = toggleInfo.GetComponent <RectTransform>(); float yMin = yMax - toggleHeight; rectTransform = AnchorChange(rectTransform, new Vector2(0, yMin), new Vector2(1 / 3f, yMax)); yMax = yMin; } return(yMax); }
float GenderGroup(Transform parent, float yMax) { genderGroup = GroupInfo(parent, "성별", yMax); yMax -= titleHeight; for (int i = 0; i < 3; i++) { string text = "선택 안 함"; if (i == 1) { text = "여성"; } if (i == 2) { text = "남성"; } ToggleInfo toggleInfo = Toggle(parent, text); toggleInfo.toggleGroup = genderGroup; toggleInfo.id = i; RectTransform rectTransform = toggleInfo.GetComponent <RectTransform>(); rectTransform = AnchorChange(rectTransform, new Vector2(i * 1 / 3f, yMax - toggleHeight), new Vector2((i + 1) * 1 / 3f, yMax)); } return(yMax - toggleHeight); }