|
- using System;
- using CIG;
- using Engine.DependencyTree;
- using SUISS.Core;
- using UnityEngine;
-
- public sealed class OngoingQuestsView : QuestTabContentView
- {
- protected override void RefreshQuests()
- {
- this._quests.Clear();
- Dependency dependency = SingletonMonobehaviour<DependencyTree>.Instance["quests"];
- int count = dependency.Children.Count;
- for (int i = 0; i < count; i++)
- {
- Dependency dependency2 = dependency.Children[i];
- if (dependency2.IsActive)
- {
- this._quests.Add(dependency2);
- }
- }
- this._recyclerView.Init(this._quests.Count, new Func<GameObject, int, bool>(this.InitQuestItem));
- }
-
- protected override void OnDeinit()
- {
- this._recyclerView.PushInstances();
- }
-
- private bool InitQuestItem(GameObject gameObject, int index)
- {
- if (index < 0 || index >= this._quests.Count)
- {
- return false;
- }
- QuestItem component = gameObject.GetComponent<QuestItem>();
- component.Initialize(this._quests[index]);
- return true;
- }
-
- public const string RegularQuestsDependencyIdentifier = "quests";
-
- [SerializeField]
- private RecyclerGridLayoutGroup _recyclerView;
- }
|