39 lines
880 B
C#
39 lines
880 B
C#
|
using System.Collections;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
[System.Serializable]
|
|||
|
public abstract class ModelData<T, V>
|
|||
|
{
|
|||
|
[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(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
|
|||
|
}
|
|||
|
|
|||
|
public abstract T MapDataToObject(string prefarbAssetName);
|
|||
|
|
|||
|
public abstract T MapDataToObject();
|
|||
|
|
|||
|
protected abstract V TryFindResource(string modelName);
|
|||
|
}
|