You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
614 B
18 lines
614 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
/// <summary>
|
|
/// This item factory literally just takes a handcrafted list of items and populates the model with that!
|
|
/// </summary>
|
|
[CreateAssetMenu]//Allows creating ViewConfig objects in Assets -> Create menu in the Unity Editor
|
|
public class ScriptedItemFactory : ItemFactory
|
|
{
|
|
public List<ScriptedItem> Items;
|
|
public override void PopulateModel(ShopModel model)
|
|
{
|
|
foreach (var item in Items)
|
|
{
|
|
model.inventory.AddItem(new Item(item.name,item.Sprite.name,item.Price));
|
|
}
|
|
}
|
|
}
|
|
|