TheMuseumProject/Assets/Scripts/Player/Interactions/ConstructMenuItem.cs

53 lines
1.2 KiB
C#

using UnityEngine;
namespace Player.Interactions
{
public class ConstructMenuItem
{
private readonly string desc;
private readonly Sprite image;
private readonly string name;
private readonly GameObject target;
public ConstructMenuItem(string name, Sprite image, string desc)
{
this.name = name;
this.image = image;
this.desc = desc;
target = null;
}
public ConstructMenuItem(string name, Sprite image, string desc, GameObject target)
{
this.name = name;
this.image = image;
int cost = target.GetComponent<ConstructBase>().GetCost();
if (cost == 1)
this.desc = desc + "\nCosts " + cost + " Nanite.";
else
this.desc = desc + "\nCosts " + cost + " Nanites.";
this.target = target;
}
public string GetName()
{
return name;
}
public Sprite GetImage()
{
return image;
}
public string GetDesc()
{
return desc;
}
public GameObject GetTarget()
{
return target;
}
}
}