Constructor CustomItem
| Improve this Doc View SourceCustomItem(GameObject, bool)
Custom item from a prefab.
Can fix references for Mock<T>s and the Recipe.
Can fix references for Mock<T>s and the Recipe.
Declaration
public CustomItem(GameObject itemPrefab, bool fixReference)
Parameters
Type | Name | Description |
---|---|---|
GameObject | itemPrefab | The prefab for this custom item. |
bool | fixReference | If true references for Mock<T> objects get resolved at runtime by Jötunn. |
CustomItem(GameObject, bool, ItemConfig)
Declaration
public CustomItem(GameObject itemPrefab, bool fixReference, ItemConfig itemConfig)
Parameters
Type | Name | Description |
---|---|---|
GameObject | itemPrefab | The prefab for this custom item. |
bool | fixReference | If true references for Mock<T> objects get resolved at runtime by Jötunn. |
ItemConfig | itemConfig | The item config for this custom item. |
CustomItem(string, bool)
Custom item created as an "empty" primitive.
At least the name and the Icon of the ItemDrop must be edited after creation.
At least the name and the Icon of the ItemDrop must be edited after creation.
Declaration
public CustomItem(string name, bool addZNetView)
Parameters
Type | Name | Description |
---|---|---|
string | name | Name of the new prefab. Must be unique. |
bool | addZNetView | If true a ZNetView component will be added to the prefab for network sync. |
CustomItem(string, bool, ItemConfig)
Custom item created as an "empty" primitive with a Recipe made from a ItemConfig.
Declaration
public CustomItem(string name, bool addZNetView, ItemConfig itemConfig)
Parameters
Type | Name | Description |
---|---|---|
string | name | Name of the new prefab. Must be unique. |
bool | addZNetView | If true a ZNetView component will be added to the prefab for network sync. |
ItemConfig | itemConfig | The item config for this custom item. |
CustomItem(string, string)
Custom item created as a copy of a vanilla Valheim prefab.
Declaration
public CustomItem(string name, string basePrefabName)
Parameters
Type | Name | Description |
---|---|---|
string | name | The new name of the prefab after cloning. |
string | basePrefabName | The name of the base prefab the custom item is cloned from. |
CustomItem(string, string, ItemConfig)
Custom item created as a copy of a vanilla Valheim prefab with a Recipe made from a ItemConfig.
Declaration
public CustomItem(string name, string basePrefabName, ItemConfig itemConfig)
Parameters
Type | Name | Description |
---|---|---|
string | name | The new name of the prefab after cloning. |
string | basePrefabName | The name of the base prefab the custom item is cloned from. |
ItemConfig | itemConfig | The item config for this custom item. |
CustomItem(AssetBundle, string, bool, ItemConfig)
Custom item from a prefab loaded from an AssetBundle with a Recipe made from a ItemConfig.
Can fix references for Mock<T>s.
Can fix references for Mock<T>s.
Declaration
public CustomItem(AssetBundle assetBundle, string assetName, bool fixReference, ItemConfig itemConfig)
Parameters
Type | Name | Description |
---|---|---|
AssetBundle | assetBundle | A preloaded AssetBundle |
string | assetName | Name of the prefab in the bundle. |
bool | fixReference | If true references for Mock<T> objects get resolved at runtime by Jötunn. |
ItemConfig | itemConfig | The item config for this custom item. |