Class BaseItemTemplate
Abstract base class for item templates, providing common properties and tooltip logic for all items. Implements ITooltip for UI display and ICachedObject for template caching.
public abstract class BaseItemTemplate : CachedScriptableObject<BaseItemTemplate>, ICachedObject, ITooltip
- Inheritance
-
ObjectScriptableObjectBaseItemTemplate
- Implements
- Derived
- Inherited Members
-
ScriptableObject.SetDirty()ScriptableObject.CreateInstance<T>()Object.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Fields
Attributes
The base attributes added to the item after generation.
[Tooltip("The base attributes that are added to the item after the ItemGenerator has completed.")]
public List<ItemAttributeTemplate> Attributes
Field Value
Generate
Indicates if the item should be generated (used in item generation systems).
public bool Generate
Field Value
IconPools
Pools of icons for item generation and randomization.
public int[] IconPools
Field Value
- int[]
IsIdentifiable
Indicates if the item can be identified (e.g., has hidden stats).
public bool IsIdentifiable
Field Value
MaxStackSize
The maximum stack size for this item (if greater than 1, item is stackable).
public uint MaxStackSize
Field Value
MeshReference
Addressable reference to the mesh for 3D representation of the item.
public AssetReference MeshReference
Field Value
- AssetReference
Price
The price of the item, used for buying/selling.
public int Price
Field Value
icon
Addressable reference to the icon sprite for this item.
public AssetReferenceSprite icon
Field Value
- AssetReferenceSprite
Properties
Icon
Gets the icon sprite for this item (loaded at runtime on client).
public Sprite Icon { get; }
Property Value
- Sprite
IsStackable
Returns true if the item is stackable (MaxStackSize > 1).
public bool IsStackable { get; }
Property Value
Mesh
Gets the mesh for this item (loaded at runtime on client).
public Mesh Mesh { get; }
Property Value
- Mesh
Name
Gets the name of this item template (defaults to the asset name).
public string Name { get; }
Property Value
Methods
BuildTooltip(TooltipBuilder)
Populates the tooltip builder with this item's tooltip lines. Override in derived types to add additional lines.
public virtual void BuildTooltip(TooltipBuilder builder)
Parameters
builderTooltipBuilderThe tooltip builder to populate.
OnLoad(string, string, int)
Called when the item template is loaded into cache. Loads the icon and mesh on the client.
public override void OnLoad(string typeName, string resourceName, int resourceID)
Parameters
typeNamestringThe type name of the resource.
resourceNamestringThe resource name.
resourceIDintThe resource ID.
OnUnload(string, string, int)
Called when the item template is unloaded from cache. Releases the icon and mesh on the client.
public override void OnUnload(string typeName, string resourceName, int resourceID)
Parameters
typeNamestringThe type name of the resource.
resourceNamestringThe resource name.
resourceIDintThe resource ID.
Tooltip()
Returns the formatted tooltip string for this item, including name and price.
public virtual string Tooltip()
Returns
- string
The formatted tooltip string.