public StoryEventDataSO GetRandomViableStoryEventData() { StoryEventDataSO storyEventReturned = viableStoryEvents[Random.Range(0, viableStoryEvents.Count)]; viableStoryEvents.Remove(storyEventReturned); return(storyEventReturned); }
// Story Event Logic #region public void LoadNewStoryEvent(StoryEventDataSO storyEvent = null) { if (storyEvent == null) { if (onlyRunTestStoryEvent) { storyEvent = testStory; } else { storyEvent = GetRandomViableStoryEventData(); } } currentStoryEvent = storyEvent; // Set up main window EnableEventScreen(); eventNameText.text = storyEvent.eventName; eventDescriptionText.text = storyEvent.eventDescription; eventImage.sprite = storyEvent.eventImageOne; // Set up buttons; if (storyEvent.actionButtonOneActive) { actionButtonOne.SetUpMyComponents(storyEvent.actionButtonOneName, storyEvent.actionButtonOneDescription); actionButtonOne.gameObject.SetActive(true); } if (storyEvent.actionButtonTwoActive) { actionButtonTwo.SetUpMyComponents(storyEvent.actionButtonTwoName, storyEvent.actionButtonTwoDescription); actionButtonTwo.gameObject.SetActive(true); } if (storyEvent.actionButtonThreeActive) { actionButtonThree.SetUpMyComponents(storyEvent.actionButtonThreeName, storyEvent.actionButtonThreeDescription); actionButtonThree.gameObject.SetActive(true); } RebuildAllModels(); }