The core of the item managment system. It takes care of the (de)serialization and changes to all data.
Public Member Functions | |
bool | Initialize () |
Tries to initialize the Itemizer. | |
ItemDefinition | AddItemDefinition (ItemScope scope, string name, int maxStackCount, string resourceIconPath, string resourcePrefabPath, string iconGUID, string prefabGUID) |
Creates a new item definition and adds it to the mangement. | |
T | AddInheritedItemDefinition< T > (ItemScope scope, string name, int maxStackCount, string resourceIconPath, string resourcePrefabPath, string iconGUID, string prefabGUID, HashSet< ItemField > itemFields) |
Creates a new item inheriting ItemDefinition and adds it to the mangement. | |
void | RemoveItemDefinition (ItemDefinition itemDefinition) |
Removes an ItemDefinition from the mangement. | |
void | EditInheritedItemDefinition< T > (ItemDefinition itemDefinition, ItemScope scope, string name, int maxStackCount, string resourceIconPath, string resourcePrefabPath, string iconGUID, string prefabGUID, HashSet< ItemField > itemFields) |
Edits a given item inheriting ItemDefinition and replaces the old within the mangement. | |
void | EditItemDefinition (ItemDefinition itemDefinition, ItemScope scope, string name, int maxStackCount, string resourceIconPath, string resourcePrefabPath, string iconGUID, string prefabGUID) |
Edits a given ItemDefinition and replaces the old within the mangement. | |
ItemScope | AddItemScope (string name) |
Adds a new ItemScope by a given unique name. | |
void | RemoveItemScope (ItemScope scope) |
Removes a given ItemScope. Replaces the given scope used for the ItemDefinition with the DefaultScope. | |
void | EditItemScope (ItemScope scope, string name) |
Edits a given ItemScope and replaces the old. | |
List< Type > | GetAllInheritedItemDefinitionTypes () |
Checks the assembly for all classes inheriting ItemDefinition. | |
void | WriteData () |
Writes all data to the set resources folder. | |
void | ItemScopeEdited (ItemScope oldScope, ItemScope newScope) |
Invokes the OnItemScopeEdited action. | |
void | ItemDefinitionEdited (ItemDefinition oldItemDefinition, ItemDefinition newItemDefinition) |
Invokes the OnItemDefinitionEdited action. | |
Properties | |
static Itemizer | Instance [get] |
The singleton instance of the Itemizer. | |
bool | Initialized [get] |
Is the itemizer initialized? If not, it cannot be used. | |
HashSet< ItemDefinition > | ItemDefinitions [get] |
All defined items. | |
HashSet< ItemDefinition > | FaultyItemDefinitions [get] |
All defined items which are faulty. | |
HashSet< ItemScope > | ItemScopes [get] |
All defined item scopes. | |
ItemScope | DefaultScope [get] |
The defaulte scope, set by default and is the replacement for deleted scopes. | |
Events | |
Action< ItemScope, ItemScope > | OnItemScopeEdited |
Action< ItemDefinition, ItemDefinition > | OnItemDefinitionEdited |
T UnityToolbox.Item.Management.Itemizer.AddInheritedItemDefinition< T > | ( | ItemScope | scope, |
string | name, | ||
int | maxStackCount, | ||
string | resourceIconPath, | ||
string | resourcePrefabPath, | ||
string | iconGUID, | ||
string | prefabGUID, | ||
HashSet< ItemField > | itemFields | ||
) |
T | A type which inherits ItemDefinition. |
scope | The scope of the definition."/></param> <param name="name">The name of the definition. Has to be unique in combination with the scope.</param> <param name="maxStackCount">How high this item can be stacked.</param> <param name="resourceIconPath">The path to where the icon can be found. Has to be a resources path.</param> <param name="resourcePrefabPath">The path to where the prefab can be found. Has to be a resources path.</param> <param name="itemFields">All additional field values defined for type <typeparamref name="T"/>.</param> <returns>The created <see cref="ItemDefinition"/>.</returns> <exception cref="ItemDefinitionException"> |
T | : | ItemDefinition |
References UnityToolbox.Item.Management.ItemField.FieldName, UnityToolbox.Item.Management.ItemField.FieldType, and UnityToolbox.Item.Management.ItemField.GetValue().
Referenced by UnityToolbox.Item.Management.Itemizer.EditInheritedItemDefinition< T >().
ItemDefinition UnityToolbox.Item.Management.Itemizer.AddItemDefinition | ( | ItemScope | scope, |
string | name, | ||
int | maxStackCount, | ||
string | resourceIconPath, | ||
string | resourcePrefabPath, | ||
string | iconGUID, | ||
string | prefabGUID | ||
) |
scope | The scope of the definition."/></param> <param name="name">The name of the definition. Has to be unique in combination with the scope.</param> <param name="maxStackCount">How high this item can be stacked.</param> <param name="resourceIconPath">The path to where the icon can be found. Has to be a resources path.</param> <param name="resourcePrefabPath">The path to where the prefab can be found. Has to be a resources path.</param> <returns>The created <see cref="ItemDefinition"/>.</returns> <exception cref="ItemDefinitionException"> |
References UnityToolbox.Item.ItemDefinition.GetQualifiedName().
Referenced by UnityToolbox.Item.Management.Itemizer.EditItemDefinition(), UnityToolbox.Item.Management.Itemizer.EditItemScope(), and UnityToolbox.Item.Management.Itemizer.RemoveItemScope().
ItemScope UnityToolbox.Item.Management.Itemizer.AddItemScope | ( | string | name | ) |
name | The unique name of the scope to create. |
ItemDefinitionException |
Referenced by UnityToolbox.Item.Management.Itemizer.EditItemScope().
void UnityToolbox.Item.Management.Itemizer.EditInheritedItemDefinition< T > | ( | ItemDefinition | itemDefinition, |
ItemScope | scope, | ||
string | name, | ||
int | maxStackCount, | ||
string | resourceIconPath, | ||
string | resourcePrefabPath, | ||
string | iconGUID, | ||
string | prefabGUID, | ||
HashSet< ItemField > | itemFields | ||
) |
T | A type which inherits ItemDefinition. |
itemDefinition | The ItemDefinition to be edited. |
scope | The new scope of the definition."/></param> <param name="name">The new name of the definition. Has to be unique in combination with the scope.</param> <param name="maxStackCount">How high this item can be stacked.</param> <param name="resourceIconPath">The new path to where the icon can be found. Has to be a resources path.</param> <param name="resourcePrefabPath">The new path to where the prefab can be found. Has to be a resources path.</param> <param name="itemFields">All additional new field values defined for type <typeparamref name="T"/>.</param> <returns>The created <see cref="ItemDefinition"/>.</returns> <exception cref="ItemDefinitionException"> |
T | : | ItemDefinition |
References UnityToolbox.Item.Management.Itemizer.AddInheritedItemDefinition< T >(), and UnityToolbox.Item.Management.Itemizer.ItemDefinitionEdited().
void UnityToolbox.Item.Management.Itemizer.EditItemDefinition | ( | ItemDefinition | itemDefinition, |
ItemScope | scope, | ||
string | name, | ||
int | maxStackCount, | ||
string | resourceIconPath, | ||
string | resourcePrefabPath, | ||
string | iconGUID, | ||
string | prefabGUID | ||
) |
itemDefinition | The ItemDefinition to be edited. |
scope | The new scope of the definition."/></param> <param name="name">The new name of the definition. Has to be unique in combination with the scope.</param> <param name="maxStackCount">How high this item can be stacked.</param> <param name="resourceIconPath">The new path to where the icon can be found. Has to be a resources path.</param> <param name="resourcePrefabPath">The new path to where the prefab can be found. Has to be a resources path.</param> <returns>The created <see cref="ItemDefinition"/>.</returns> <exception cref="ItemDefinitionException"> |
References UnityToolbox.Item.Management.Itemizer.AddItemDefinition(), and UnityToolbox.Item.Management.Itemizer.ItemDefinitionEdited().
void UnityToolbox.Item.Management.Itemizer.EditItemScope | ( | ItemScope | scope, |
string | name | ||
) |
scope | The ItemScope to edit. |
name | The new unique name of the scope. |
ItemDefinitionException |
References UnityToolbox.Item.Management.Itemizer.AddItemDefinition(), UnityToolbox.Item.Management.Itemizer.AddItemScope(), UnityToolbox.Item.Management.ItemScope.Equals(), UnityToolbox.Item.ItemDefinition.IconGUID, UnityToolbox.Item.ItemDefinition.IconPath, UnityToolbox.Item.Management.Itemizer.ItemScopeEdited(), UnityToolbox.Item.ItemDefinition.MaxStackCount, UnityToolbox.Item.Management.ItemScope.Name, UnityToolbox.Item.ItemDefinition.Name, UnityToolbox.Item.ItemDefinition.PrefabGUID, and UnityToolbox.Item.ItemDefinition.PrefabPath.
Referenced by UnityToolbox.Item.Management.Editor.ItemScopeEditWindow.OnGUI().
List< Type > UnityToolbox.Item.Management.Itemizer.GetAllInheritedItemDefinitionTypes | ( | ) |
bool UnityToolbox.Item.Management.Itemizer.Initialize | ( | ) |
References ProjectPrefs.GetString(), and ResourcesUtil.IsFullPathValid().
Referenced by UnityToolbox.Item.ItemManager.Awake().
void UnityToolbox.Item.Management.Itemizer.ItemDefinitionEdited | ( | ItemDefinition | oldItemDefinition, |
ItemDefinition | newItemDefinition | ||
) |
oldItemDefinition | |
newItemDefinition |
References UnityToolbox.Item.Management.Itemizer.OnItemDefinitionEdited.
Referenced by UnityToolbox.Item.Management.Itemizer.EditInheritedItemDefinition< T >(), UnityToolbox.Item.Management.Itemizer.EditItemDefinition(), and UnityToolbox.Item.Management.Itemizer.RemoveItemDefinition().
void UnityToolbox.Item.Management.Itemizer.ItemScopeEdited | ( | ItemScope | oldScope, |
ItemScope | newScope | ||
) |
oldScope | |
newScope |
References UnityToolbox.Item.Management.Itemizer.OnItemScopeEdited.
Referenced by UnityToolbox.Item.Management.Itemizer.EditItemScope(), and UnityToolbox.Item.Management.Itemizer.RemoveItemScope().
void UnityToolbox.Item.Management.Itemizer.RemoveItemDefinition | ( | ItemDefinition | itemDefinition | ) |
itemDefinition | The ItemDefinition to be removed. |
ItemDefinitionException |
References UnityToolbox.Item.ItemDefinition.GetQualifiedName(), and UnityToolbox.Item.Management.Itemizer.ItemDefinitionEdited().
void UnityToolbox.Item.Management.Itemizer.RemoveItemScope | ( | ItemScope | scope | ) |
scope | The ItemScope to remove. |
ItemDefinitionException |
References UnityToolbox.Item.Management.Itemizer.AddItemDefinition(), UnityToolbox.Item.Management.ItemScope.Equals(), UnityToolbox.Item.ItemDefinition.IconGUID, UnityToolbox.Item.ItemDefinition.IconPath, UnityToolbox.Item.Management.Itemizer.ItemScopeEdited(), UnityToolbox.Item.ItemDefinition.MaxStackCount, UnityToolbox.Item.Management.ItemScope.Name, UnityToolbox.Item.ItemDefinition.Name, UnityToolbox.Item.ItemDefinition.PrefabGUID, and UnityToolbox.Item.ItemDefinition.PrefabPath.
void UnityToolbox.Item.Management.Itemizer.WriteData | ( | ) |
References ResourcesUtil.WriteFile().
Referenced by UnityToolbox.Item.Management.Editor.ItemScopeEditWindow.OnGUI().
|
get |
|
get |
|
get |
Referenced by UnityToolbox.Item.ItemManager.SpawnItemInstance().
|
staticget |
|
get |
Referenced by UnityToolbox.Item.ItemManager.SpawnItemInstance().
|
get |
Action<ItemDefinition, ItemDefinition> UnityToolbox.Item.Management.Itemizer.OnItemDefinitionEdited |
Referenced by UnityToolbox.Item.Management.Itemizer.ItemDefinitionEdited().
Referenced by UnityToolbox.Item.Management.Itemizer.ItemScopeEdited().