Class BodySetItem
Represent an item that holds a whole set of bodypart for pose-style characters to apply
Implements
Constructors
BodySetItem(string)
Declaration
public BodySetItem(string basicName)
BodySetItem(Type)
Declaration
public BodySetItem(Type characterType)
Properties
Data
Rendering config data for the bodypart it holds
Declaration
public CharacterRenderingConfig Data { get; init; }
TargetCharacterID
ID of the target character for the bodypart it holds
Declaration
public int TargetCharacterID { get; init; }
TargetCharacterName
Name of the target character for the bodypart it holds
Declaration
public string TargetCharacterName { get; init; }
Methods
CanUse(Character)
True if this item can be use at current frame
Declaration
public override bool CanUse(Character holder)
Parameters
Type | Name | Description |
---|---|---|
Character | holder | Holder that trying to use this item |
Overrides
DrawItem(Entity, IRect, Color32, int)
Call this function to render the item
Declaration
public override void DrawItem(Entity holder, IRect rect, Color32 tint, int z)
Parameters
Type | Name | Description |
---|---|---|
Entity | holder | Holder that own this item |
IRect | rect | Rect position in global space |
Color32 | tint | Color tint |
int | z | Z value for sort rendering cells |
Overrides
ForAllBodySetCharacterType()
Iterate through all body-set the current project have
Declaration
public static IEnumerable<KeyValuePair<int, (Type, string)>> ForAllBodySetCharacterType()
Examples
using AngeliA;
namespace AngeliaGame;
public class Example {
[OnGameInitializeLater(4096)]
internal static void OnGameUpdate () {
Debug.Log("All body-set inside this game:");
foreach (var (id, (type, typeName)) in BodySetItem.ForAllBodySetCharacterType()) {
string setName = ItemSystem.GetItemDisplayName(id);
Debug.Log($"{setName} - {typeName}");
}
}
}
GetDisplayName(string, out int)
Get display name for bodyset from language system
Declaration
public string GetDisplayName(string typeName, out int languageID)
Use(Character, int, int, out bool)
Perform the logic when the item get used
Declaration
public override bool Use(Character holder, int inventoryID, int itemIndex, out bool consume)
Parameters
Type | Name | Description |
---|---|---|
Character | holder | Holder that using this item |
int | inventoryID | Inventory ID of this holder |
int | itemIndex | Index of this item inside the inventory |
bool | consume | True if the item should disappear after being used |
Returns
Type | Description |
---|---|
bool | True if the item is used |