public EventResultWrapper(EventResultSobj sobj, EventOptionSobj option) { Sobj = sobj; sobj.wrapper = this; Option = option; EventSource = option.wrapper.EventSource; }
private void CreateOption(EventOptionSobj option, int idx) { var obj = Instantiate(optionUIPrefab, optionList, false); var scrp = obj.GetComponent <EventOptionUI>(); options[idx] = scrp; scrp.SetOption(this, option, idx); }
/// <summary> Called by <c>EventUI</c> i.e. the parent UI </summary> public void SetOption(EventUI parentUI, EventOptionSobj option, int idx) { this.parentUI = parentUI; this.idx = idx; description.text = option.mainDescription; button.interactable = option.wrapper.CanUnlock(option); button.onClick.RemoveAllListeners(); button.onClick.AddListener(OnClick); }