Skip to content

ItemUsesAttribute

namespace Griff.Scenes;
public sealed class ItemUsesAttribute : FieldEditorAttribute

Marks a list of strings as what items do when they’re used, one a line: the item, a colon, and what it does, several separated by commas: “heal 3”, “spawn Explosion” (a prefab), “send Teleport” (a message), e.g. “Bomb: spawn Explosion, send Boom” (an inventory’s Item Uses). The Inspector lists each item with what it does a row each, the item, prefab and message picked from the project’s.

public override string FitsText { get; }
public static IReadOnlyList<string> Verbs { get; }

What an item can do: heal hit points, spawn a prefab, send a message.

public override string Describe()
public override bool Fits(Type type)
public override string? Problem(Component component, object? value)
public static ValueTuple<string, IReadOnlyList<ValueTuple<string, string>>>? Read(string line)

A line read, every effect kept as written (verbs in small letters); null when it has no colon.