Skip to main content

ItemComponent

An abstract class in Root.Township, the global namespace.

Base for an asset that adds data to an Item, such as CookableItem. Can be limited to some physical materials.

Constructors​

MemberWhat it is
protected ItemComponent()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

1 private and internal field
MemberWhat it is
private List<PhysicalMaterial> physicalMaterialsMaterials this component applies to; empty means all. Checked by CheckMatch.

Properties​

MemberWhat it is
Item Item { get; private set; }The item this component is attached to, set when the item initializes.

Methods​

MemberWhat it is
bool CheckMatch(PhysicalMaterial physicalMaterial)Whether this component applies to a physical material. True if none are listed or the material is null.
1 private and internal method
MemberWhat it is
private void IItemComponent.Initialize(Item item)Stores the item this component belongs to in Item.

Used in​

Members of other types that take, return or hold a ItemComponent: