Table of Contents

Class TemplateReferenceAttribute

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Marks an int or List<int> field as a template ID reference. In the Inspector, the field displays an object picker for the specified CachedScriptableObject type but serializes only the deterministic ID.

[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
public sealed class TemplateReferenceAttribute : PropertyAttribute
Inheritance
PropertyAttribute
TemplateReferenceAttribute
Inherited Members
PropertyAttribute.order
PropertyAttribute.applyToCollection

Constructors

TemplateReferenceAttribute(string)

Creates a TemplateReferenceAttribute naming its template type by its full name, for a core field that refers to a module's template (the scene namer's name modifier is the Naming module's): resolved when first read, and a plain ScriptableObject picker when the module is not installed.

public TemplateReferenceAttribute(string typeName)

Parameters

typeName string

The template type's full name, e.g. "FishMMO.Shared.NameGeneration.NameModifierTemplate".

TemplateReferenceAttribute(Type)

Creates a new TemplateReferenceAttribute targeting the given template type.

public TemplateReferenceAttribute(Type templateType)

Parameters

templateType Type

The ScriptableObject type to show in the picker.

Properties

TemplateType

The CachedScriptableObject-derived type to pick from.

public Type TemplateType { get; }

Property Value

Type