private GameObject InitialiseScheduleContainer() { GameObject scheduleObject = new GameObject(JobConstants.scheduleContainerName); scheduleObject.transform.parent = gameObject.transform; Image scheduleImage = scheduleObject.AddComponent <Image>(); scheduleImage.sprite = containerBackgroundSprite; scheduleObject.AddComponent <CanvasGroup>(); scheduleObject.AddComponent <Schedule>(); RectTransform rectTransform = scheduleObject.GetComponent <RectTransform>(); rectTransform.localPosition = new Vector2(0.5f, 0f); rectTransform.anchorMin = JobConstants.scheduleContainerAnchorMin; rectTransform.anchorMax = JobConstants.scheduleContainerAnchorMax; rectTransform.localScale = JobConstants.scheduleContainerLocalScale; rectTransform.offsetMin = Vector2.zero; rectTransform.offsetMax = Vector2.zero; JobsUtils.SetupGridLayoutGroup(scheduleObject); return(scheduleObject); }
private GameObject InitialiseAvailableJobsContainer() { GameObject containerObject = new GameObject(JobConstants.availableJobsContainerName); containerObject.transform.parent = gameObject.transform; Image containerImage = containerObject.AddComponent <Image>(); containerImage.sprite = containerBackgroundSprite; RectTransform rectTransform = containerObject.GetComponent <RectTransform>(); rectTransform.anchorMin = JobConstants.availableJobsContainerAnchorMin; rectTransform.anchorMax = JobConstants.availableJobsContainerAnchorMax; rectTransform.localPosition = Vector2.left; rectTransform.localScale = new Vector2(0.75f, 0.75f); rectTransform.offsetMin = Vector2.zero; rectTransform.offsetMax = Vector2.zero; JobsUtils.SetupGridLayoutGroup(containerObject); return(containerObject); }