67 lines
1.8 KiB
C#
67 lines
1.8 KiB
C#
![]() |
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
[Serializable]
|
|||
|
public abstract class DialogueData<T> : ModelData<T, T>
|
|||
|
{
|
|||
|
protected override string SPRITE_LOCALIZATION => "";
|
|||
|
protected override string MODEL_LOCALIZATION => "Dialogue/";
|
|||
|
|
|||
|
[SerializeField]
|
|||
|
public int CurrentStep;
|
|||
|
|
|||
|
[SerializeField]
|
|||
|
public List<DialogueStepData> DialogueStepModelDataList = new List<DialogueStepData>();
|
|||
|
}
|
|||
|
|
|||
|
public class DialogueData : DialogueData<Dialogue>
|
|||
|
{
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// build Data model based on Object
|
|||
|
/// </summary>
|
|||
|
/// <param name="dialogue"></param>
|
|||
|
public DialogueData(Dialogue dialogue)
|
|||
|
{
|
|||
|
CurrentStep = dialogue.CurrentStep;
|
|||
|
|
|||
|
DialogueStepModelDataList.Clear();
|
|||
|
|
|||
|
foreach(DialogueStepModel dialogueStepModelData in dialogue.DialogueSteps)
|
|||
|
{
|
|||
|
/*
|
|||
|
* pass WasDisplayed value from model to data representative class
|
|||
|
*/
|
|||
|
DialogueStepModelDataList.Add(new DialogueStepData(dialogueStepModelData.WasDisplayed));
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#region NotImplemented
|
|||
|
/*
|
|||
|
* we dont want to map it here, we will mark fields in NpcDialogfeManager after each loading and fetching dialogue
|
|||
|
*/
|
|||
|
public override Dialogue MapDataToObject(string prefarbAssetName)
|
|||
|
{
|
|||
|
throw new NotImplementedException();
|
|||
|
}
|
|||
|
|
|||
|
/*
|
|||
|
* we dont want to map it here, we will mark fields in NpcDialogfeManager after each loading and fetching dialogue
|
|||
|
*/
|
|||
|
public override Dialogue MapDataToObject()
|
|||
|
{
|
|||
|
throw new NotImplementedException();
|
|||
|
}
|
|||
|
|
|||
|
protected override Dialogue TryFindResource(string modelName)
|
|||
|
{
|
|||
|
throw new NotImplementedException();
|
|||
|
}
|
|||
|
#endregion
|
|||
|
}
|
|||
|
|