Scriptum/Assets/Scripts/REFACTORING/Models/Shared/ModelData.cs

40 lines
925 B
C#
Raw Normal View History

using System.Collections;
using UnityEngine;
[System.Serializable]
public abstract class ModelData<T, V> : IModelMapper<T>
{
[SerializeField]
public int id;
[SerializeField]
public string name;
// to handle object created on scene for example after removing from inventory
[SerializeField]
public string modelName;
protected virtual string SPRITE_LOCALIZATION => "";
protected virtual string MODEL_LOCALIZATION => "";
public ModelData() { }
public ModelData(int _id, string _name)
{
id = _id;
name = _name;
}
public ModelData(int _id, string _name, string _modelName)
{
id = _id;
name = _name;
modelName = _modelName; // name of the prefab
}
protected abstract V TryFindResource(string modelName);
public abstract T MapDataToObject(string prefarbAssetName);
public abstract T MapDataToObject();
}