| | 1 | | using DCL.QuestsController; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using UnityEngine; |
| | 4 | | using DCL.Helpers; |
| | 5 | |
|
| | 6 | | public class QuestsBridge : MonoBehaviour |
| | 7 | | { |
| | 8 | | public void InitializeQuests(string jsonMessage) |
| | 9 | | { |
| 0 | 10 | | var parsedQuests = Utils.ParseJsonArray<List<QuestModel>>(jsonMessage); |
| 0 | 11 | | QuestsController.i.InitializeQuests(parsedQuests); |
| 0 | 12 | | } |
| | 13 | |
|
| | 14 | | public void UpdateQuestProgress(string jsonMessage) |
| | 15 | | { |
| 0 | 16 | | var progressedQuest = JsonUtility.FromJson<QuestModel>(jsonMessage); |
| 0 | 17 | | QuestsController.i.UpdateQuestProgress(progressedQuest); |
| 0 | 18 | | } |
| | 19 | |
|
| | 20 | | public void RemoveQuest(string jsonMessage) |
| | 21 | | { |
| 0 | 22 | | var quest = JsonUtility.FromJson<QuestModel>(jsonMessage); |
| 0 | 23 | | QuestsController.i.RemoveQuest(quest); |
| 0 | 24 | | } |
| | 25 | |
|
| 104 | 26 | | private void OnDestroy() { QuestsController.i?.Dispose(); } |
| | 27 | | } |