123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using FL.FGUI;
- using XGame.Framework.Nodes;
- namespace FL.Nodes.Summon
- {
- public class UIComponent : NodeComponent
- {
- public override void OnEnable(object intent)
- {
- Context.AddListener(EventDefine.SummonInto, OnSummonInto);
- Context.AddListener(EventDefine.SummonMwDraw, OnSummonMwDraw);
- Context.AddListener(EventDefine.SummonSbDraw, OnSummonSbDraw);
- Context.AddListener(EventDefine.AdSuccess, OnAdSuccess);
- }
- public override void OnDisable()
- {
- Context.RemoveListener(EventDefine.SummonInto, OnSummonInto);
- Context.RemoveListener(EventDefine.SummonMwDraw, OnSummonMwDraw);
- Context.RemoveListener(EventDefine.SummonSbDraw, OnSummonSbDraw);
- Context.RemoveListener(EventDefine.AdSuccess, OnAdSuccess);
- }
- private void OnAdSuccess(int eventId, object args)
- {
- //if () return;
- //if ()
- //{
- // EventSingle.Instance.Notify(EventDefine.SummonSbAd);
- // OnSummonSbDraw(eventId,args);
- //}
- //else
- //{
- // EventSingle.Instance.Notify(EventDefine.SummonMwAd);
- // OnSummonMwDraw(eventId,args);
- //}
- }
- private void OnSummonMwDraw(int eventId, object args)
- {
- if (Context.UI.IsOpened(UIKeys.PartnerSummonMwResultPanel)) return;
- Context.UI.OpenAsync(UIKeys.PartnerSummonMwResultPanel);
- }
- private void OnSummonSbDraw(int eventId, object args)
- {
- if (Context.UI.IsOpened(UIKeys.PartnerSummonSbResultPanel)) return;
- Context.UI.OpenAsync(UIKeys.PartnerSummonSbResultPanel);
- }
- private void OnSummonInto(int eventId, object args)
- {
- Context.UI.OpenAsync(UIKeys.PartnerSummonMainPanel);
- }
- }
- }
|