public void EventSelection(ScriptableAction eve, bool decision = false) { acceptedEvents.Add(eve); if (!decision) { _technologyParent = acceptedEvents[acceptedEvents.Count - 1].uiTransform; if (acceptedEvents.Count > 1) { foreach (ScriptableAction ev in acceptedEvents[acceptedEvents.Count - 2].connectedEvents) { if (acceptedEvents[acceptedEvents.Count - 1] != ev) { unManagedEvents.Add(ev); } } } for (int i = 0; i < acceptedEvents[acceptedEvents.Count - 1].connectedEvents.Length; ++i) { ActionButtonBehaviour button = Instantiate(_eventPrefab, _technologyParent).GetComponent <ActionButtonBehaviour>(); button.action = acceptedEvents[acceptedEvents.Count - 1].connectedEvents[i]; button.index = i; button.world = this; } } AddEventToIndustry(acceptedEvents[acceptedEvents.Count - 1]); }
public void GeneratePrefabs() { for (int i = 0; i < action.Length; ++i) { ActionButtonBehaviour button = Instantiate(_actionPrefab, _layout.transform).GetComponent <ActionButtonBehaviour>(); button.action = action[i]; button.index = i; button.world = world; button.choiceContainer = this; } }