Ejemplo n.º 1
0
 public void Init(Talker questHolder)
 {
     this.questHolder = questHolder;
     if (MapManager.Instance)
     {
         if (mapIcon)
         {
             MapManager.Instance.RemoveMapIcon(mapIcon, true);
         }
         mapIcon = MapManager.Instance.CreateMapIcon(notAccepted, Vector2.one * 48, questHolder.GetData <TalkerData>().currentPosition, false, MapIconType.Quest, false);
         mapIcon.iconImage.raycastTarget = false;
         mapIcon.Hide();
     }
     triggerNames.Clear();
     foreach (var quest in questHolder.QuestInstances)
     {
         Condition find = quest.Model.AcceptCondition.Conditions.Find(x => x.Type == ConditionType.TriggerSet || x.Type == ConditionType.TriggerReset);
         if (find)
         {
             triggerNames.Add(find.TriggerName);
         }
     }
     UpdateUI();
     Update();
     NotifyCenter.RemoveListener(this);
     NotifyCenter.AddListener(QuestManager.QuestStateChanged, _ => UpdateUI(), this);
     NotifyCenter.AddListener(QuestManager.ObjectiveUpdate, _ => UpdateUI(), this);
     NotifyCenter.AddListener(NotifyCenter.CommonKeys.TriggerChanged, OnTriggerChange, this);
 }
Ejemplo n.º 2
0
 protected override void RegisterNotify()
 {
     NotifyCenter.RemoveListener(this);
     if (SourceHandler != null)
     {
         NotifyCenter.AddListener(SourceHandler.ItemAmountChangedMsgKey, OnItemAmountChanged, this);
     }
 }
Ejemplo n.º 3
0
 protected override void OnDestroy_()
 {
     if (handler != null)
     {
         NotifyCenter.RemoveListener(handler.ItemAmountChangedMsgKey, OnItemAmountChanged);
     }
     base.OnDestroy_();
 }
Ejemplo n.º 4
0
 private void OnDestroy()
 {
     if (MapManager.Instance)
     {
         MapManager.Instance.RemoveMapIcon(mapIcon);
     }
     NotifyCenter.RemoveListener(this);
 }
Ejemplo n.º 5
0
 public void Recycle()
 {
     NotifyCenter.RemoveListener(this);
     if (MapManager.Instance)
     {
         MapManager.Instance.RemoveMapIcon(mapIcon, true);
     }
     questHolder = null;
     mapIcon     = null;
     ObjectPool.Put(gameObject);
 }
Ejemplo n.º 6
0
 public void Init()
 {
     foreach (var quest in questsInProgress)
     {
         foreach (ObjectiveData o in quest.Objectives)
         {
             RemoveObjectiveMapIcon(o);
         }
     }
     questsInProgress.Clear();
     questsFinished.Clear();
     NotifyCenter.RemoveListener(this);
     NotifyCenter.AddListener(NotifyCenter.CommonKeys.TriggerChanged, OnTriggerChange);
 }
Ejemplo n.º 7
0
 protected override void OnExit()
 {
     NotifyCenter.RemoveListener(this);
 }
Ejemplo n.º 8
0
 private void OnDestroy()
 {
     NotifyCenter.RemoveListener(this);
 }
Ejemplo n.º 9
0
 /// <summary>
 /// 取消消息监听
 /// </summary>
 protected virtual void UnregisterNotify()
 {
     NotifyCenter.RemoveListener(this);
 }
Ejemplo n.º 10
0
 private void UnregisterNotify()
 {
     NotifyCenter.RemoveListener(this);
 }