private void SetStories(Story[] stories) { foreach (Story story in stories) { StoryButton button = GameObject.Instantiate(this.buttonPrefab) as StoryButton; button.SetSpeechBubble(this.speechBubble); button.transform.SetParent(this.buttonParent, false); button.SetStory(story); } this.speechBubble.SetActive(false); }
void SetObjects() { for (int i = 0; i < (int)HeartIcons.Count; i++) { HeartIcon icon = Get <HeartIcon>(i); StoryButton story = Get <StoryButton>(i); if (i >= myBird.MaxLevel) { icon.gameObject.SetActive(false); story.gameObject.SetActive(false); } else { icon.gameObject.SetActive(true); story.gameObject.SetActive(true); icon.SetIcon((float)i / (myBird.MaxLevel - 1), (myBird.Level > i)); story.SetIcon(i + 1, (myBird.Level <= i + 1)); } } Get <RectTransform>((int)RectTransforms.StoryList).sizeDelta = new Vector2(0, (myBird.MaxLevel * Define.StoryButtonsSpacing) + 25); }