44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
[System.Serializable]
|
|
public class EquippableItemPrefabAsset : PrefabAssetModel
|
|
{
|
|
|
|
[SerializeField]
|
|
public EquippableItem EquippableItem = null;
|
|
|
|
public EquippableItemPrefabAsset() { }
|
|
|
|
public EquippableItemPrefabAsset(string _name, string _prefabAssetName, Vector3 _position, EquippableItem _equippableItem = null)
|
|
: base(_name, _prefabAssetName, _position)
|
|
{
|
|
EquippableItem = _equippableItem;
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="_name"></param>
|
|
/// <param name="_prefabAssetName"></param>
|
|
/// <param name="_position"></param>
|
|
/// <param name="_equippableItemName">the name by which the system will search for the item</param>
|
|
public EquippableItemPrefabAsset(string _name, string _prefabAssetName, Vector3 _position, string _equippableItemName)
|
|
: base(_name, _prefabAssetName, _position)
|
|
{
|
|
// 3.2 set EquippableItem object
|
|
EquippableItem = Resources.Load<EquippableItem>("Items/" + _equippableItemName);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Function to convert Prefab Asset model to data object
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public EquippableItemPrefabAssetData MapPrefabAssetModelToData()
|
|
{
|
|
return new EquippableItemPrefabAssetData(this);
|
|
}
|
|
}
|
|
|
|
|