123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System;
- using System.Linq;
- using Core.Language;
- using Excel2Json;
- using Fort23.UTool;
- namespace Fort23.Mono
- {
- [UIBinding(prefab = "DialogueOptionWidget")]
- public partial class DialogueOptionWidget : UIComponent
- {
- public EventConditionConfig eventConditionConfig;
- private Action<DialogueOptionWidget> callback;
- private void Init()
- {
- }
- public override void AddEvent()
- {
- }
- public override void DelEvent()
- {
- }
- public override void AddButtonEvent()
- {
- OptionWidget.onClick.AddListener(() => { callback?.Invoke(this); });
- }
- public void CustomInit(int id, int mainOpid, Action<DialogueOptionWidget> callback)
- {
- eventConditionConfig = ConfigComponent.Instance.Get<EventConditionConfig>(id);
- var mainEventConditionConfig = ConfigComponent.Instance.Get<EventConditionConfig>(mainOpid);
- int index = mainEventConditionConfig.optionPara1.ToList().IndexOf(eventConditionConfig.ID);
- Text_desc.text = LanguageManager.Instance.Text(mainEventConditionConfig.optionPara2[index]);
- this.callback = callback;
- }
- }
- }
|