KitchenLib provides a number of available utilities designed for ease of use, and simplicity for developers.
Method | Returns | Arguments | Description |
---|---|---|---|
AddPurchaseCostOverride |
void |
int applianceId , int cost |
This is used to override the purchase cost on an Appliance assigned by Appliance.PriceTier |
RemovePurchaseCostOverride |
void |
int applianceId |
This is used to reverse the effect of the previous AddPurchaseCostOverride |
Method | Returns | Arguments | Description |
---|---|---|---|
AddProcessAudioClip |
void |
int process , AudioClip clip |
This is used to override the AudioClip played when a Process is being actioned by the Player |
GetProcessAudioClip |
AudioClip |
int process |
This gets the AudioClip of a Process if it has been assigned with AddProcessAudioClip |
DoesProcessAudioClipExist |
bool |
int process |
This checks if an AudioClip has been assigned with AddProcessAudioClip |
Method | Returns | Arguments | Description |
---|---|---|---|
GetExistingTMPFont |
TMP_FontAsset |
string font |
This is used to get an existing TMP_FontAsset already in the game |
GetExistingFont |
Font |
string font |
This is used to get an existing Font already in the game |
Method | Returns | Arguments | Description |
---|---|---|---|
GetChildObject |
GameObject |
GameObject prefab , string childPath |
This is used to get a child GameObject from the parent using a string path |
GetChild |
GameObject |
this GameObject parent , string childPath |
This is used to get a child GameObject from the parent using a string path |
GetChild |
GameObject |
this GameObject parent , int childIndex |
This is used to get a child GameObject from the parent using its int index |
GetChildCount |
int |
this GameObject parent |
This is used to a count of how many children are in a GameObject |
HasComponent<T> |
bool |
this GameObject gameObject |
This is used to check if a GameObject has a specific Component attached |
TryAddComponent<T> |
bool |
this GameObject gameObject |
This is used to add a Component to a GameObject if its not already attached |
CopyComponent |
Component |
Component original , GameObject destination |
This is used to clone a Component from one GameObject to another |
Method | Returns | Arguments | Description |
---|---|---|---|
GetExistingGDO |
GameDataObject |
int id |
This is used to get an existing GameDataObject |
GetCustomGameDataObject |
CustomGameDataObject |
string modID , string name |
This is used to get a custom CustomGameDataObject |
GetCustomGameDataObjectsFromMod |
List<CustomGameDataObject> |
string modID |
This is used to get all CustomGameDataObject s registered by a specific mod |
GetCustomGameDataObject |
CustomGameDataObject |
int id |
This is used to get a custom CustomGameDataObject |
GetCustomGameDataObject<T> |
CustomGameDataObject |
This is used to get a custom CustomGameDataObject |
|
GetCastedGDO<T, C> |
T |
This is used to get a custom CustomGameDataObject pre casted as T |
|
AddAutomatedParcel |
void |
Item item |
|
BlacklistSide |
void |
Item item , int side |
This is used to prevent a specific side from being requested with a specific Dish |
WhitelistSide |
void |
Item item , int side |
This is used to reverse the effects of BlacklistSide |
GetItemProcessResult |
int |
Item item , Process process |
This is used to get the result of an Item going through a Process |
Method | Returns | Arguments | Description |
---|---|---|---|
AddPossibleSide |
void |
GameData gameData, Item item |
|
AddSideContainer<T> |
void |
GameData gameData , ItemGroup itemGroup , T localView |
Method | Returns | Arguments | Description |
---|---|---|---|
AddRewardOverride |
void |
int itemId , int reward |
This is used to override the reward amount when serving an Item assigned by Item.ItemValue |
RemoveRewardOverride |
void |
int itemId |
This is used to reverse the effect of the previous AddRewardOverride |
Method | Returns | Arguments | Description |
---|---|---|---|
CreateApplianceInfo |
ApplianceInfo |
string name , string description , List<Appliance.Section> sections , List<string> tags |
This is used to provide a safe method of creating an ApplianceInfo |
CreateCosmeticInfo |
CosmeticInfo |
string name , string description |
This is used to provide a safe method of creating an CosmeticInfo |
CreateEffectInfo |
EffectInfo |
string name , string description , string icon |
This is used to provide a safe method of creating an EffectInfo |
CreateProcessInfo |
ProcessInfo |
string name , string icon |
This is used to provide a safe method of creating an ProcessInfo |
CreateResearchLocalisation |
ResearchLocalisation |
string name , string description , string flavourText |
This is used to provide a safe method of creating an ResearchLocalisation |
CreateUnlockInfo |
UnlockInfo |
string name , string description , string flavourText |
This is used to provide a safe method of creating an UnlockInfo |
CreateBasicInfo |
BasicInfo |
string name , string description |
This is used to provide a safe method of creating an BasicInfo |
CreateContractInfo |
ContractInfo |
string name, string description |
This is used to provide a safe method of creating an ContractInfo |
CreateDecorationBonusInfo |
DecorationBonusInfo |
Dictionary<DecorationType, string> icons , Dictionary<DecorationBonus, string> text |
This is used to provide a safe method of creating an DecorationBonusInfo |
CreateDictionaryInfo |
DictionaryInfo |
Dictionary<string, string> text |
This is used to provide a safe method of creating an DictionaryInfo |
CreateEnumInfo<T> |
EnumInfo<T> |
Dictionary<T, string> name |
This is used to provide a safe method of creating an EnumInfo<T> |
CreateEnumBasicInfo<T> |
EnumBasicInfo<T> |
Dictionary<T, GenericLocalisationStruct> text |
This is used to provide a safe method of creating an EnumBasicInfo<T> |
CreatePopupText |
PopupText |
Dictionary<PopupType, PopupDetails> text |
This is used to provide a safe method of creating an PopupText |
CreateRecipeInfo |
RecipeInfo |
Dictionary<Dish, string> text |
This is used to provide a safe method of creating an RecipeInfo |
CreateTutorialText |
TutorialText |
Dictionary<TutorialMessage, TutorialDetails> text |
This is used to provide a safe method of creating an TutorialText |
Method | Returns | Arguments | Description |
---|---|---|---|
ApplyMaterial |
void |
GameObject parent , string childPath , Material[] materials |
Apply a material array to a child renderer |
ApplyMaterial<T> |
void |
GameObject parent , string childPath , Material[] materials |
Apply a material array to a child renderer |
ApplyMaterial<T> |
GameObject |
this GameObject gameObject , params Material[] materials |
Apply a material array to a GameObject's renderer |
ApplyMaterial |
GameObject |
this GameObject gameObject , params Material[] materials |
Apply a material array to a GameObject's renderer |
ApplyMaterial |
GameObject |
this GameObject gameObject , params string[] materials |
Apply a material array to a GameObject's renderer |
ApplyMaterialToChildren<T> |
GameObject |
this GameObject parent , string nameContains , Material[] materials |
Apply a material array to all children of a GameObject |
ApplyMaterialToChildren |
GameObject |
this GameObject parent , string nameContains , Material[] materials |
Apply a material array to all children of a GameObject |
ApplyMaterialToChildren |
GameObject |
this GameObject parent , string nameContains , params string[] materials |
Apply a material array to all children of a GameObject |
ApplyMaterialToChildren<T> |
GameObject |
this GameObject parent , Material[] materials |
Apply a material array to all children of a GameObject |
ApplyMaterialToChildren |
GameObject |
this GameObject parent , Material[] materials |
Apply a material array to all children of a GameObject |
ApplyMaterialToChildren |
GameObject |
this GameObject parent , params string[] materials |
Apply a material array to all children of a GameObject |
ApplyMaterialToChild<T> |
GameObject |
this GameObject parent , string childPath , Material[] materials |
Apply a material array to a child of a GameObject |
ApplyMaterialToChild |
GameObject |
this GameObject parent , string childPath , Material[] materials |
Apply a material array to a child of a GameObject |
ApplyMaterialToChild |
GameObject |
this GameObject parent , string childPath , params string[] materials |
Apply a material array to a child of a GameObject |
GetAllMaterials |
List<Material> |
bool includeCustom |
Gets a list of all Materials |
GetAllMaterials |
List<Material> |
bool includeCustom , List<string> shaders |
Gets a list of all Materials |
GetExistingMaterial |
Material |
string materialName |
Get a vanilla material by name |
GetCustomMaterial |
Material |
string materialName |
Get a custom material by name |
GetMaterialArray |
Material[] |
params string[] materials |
Get a material array from a array of material names |
ColorFromHex |
Color |
int hex |
Get a Unity Color from a hex code |
CreateFlat |
Material |
string name , Color color , float shininess = 0 , float overlayScale = 10 |
Creates a new Material with the Simple Flat shader |
CreateFlat |
Material |
string name , int color , float shininess = 0 , float overlayScale = 10 |
Creates a new Material with the Simple Flat shader |
CreateTransparent |
Material |
string name , Color color |
Creates a new Material with the Simple Transparent shader |
CreateTransparent |
Material |
string name , int color , float opacity |
Creates a new Material with the Simple Transparent shader |
AssignMaterialsByNames |
GameObject |
GameObject gameObject |
Replace Materials from the Unity Editor with Materials from PlateUp! |
Method | Returns | Arguments | Description |
---|---|---|---|
GetMethod<T> |
MethodInfo |
string methodName |
Used to get a MethodInfo from a targeted method |
GetMethod<T> |
MethodInfo |
string methodName , BindingFlags flags |
Used to get a MethodInfo from a targeted method |
GetMethod |
MethodInfo |
Type type , string methodName |
Used to get a MethodInfo from a targeted method |
GetField<T> |
FieldInfo |
string fieldName |
Used to get a FieldInfo from a targeted field |
GetField<T> |
FieldInfo |
string fieldName , BindingFlags flags |
Used to get a FieldInfo from a targeted field |
Method | Returns | Arguments | Description |
---|---|---|---|
LoadTextureFromBase64 |
Texture2D |
string base64 |
Converts base64 to a Texture2D |
LoadTextureRaw |
Texture2D |
byte[] file |
Converts raw bytes to a Texture2D |
LoadTextureFromFile |
Texture2D |
string FilePath |
Loads Texture2D from image file |
LoadTextureFromResources |
Texture2D |
string resourcePath |
Loads Texture2D from Resource |
LoadSpriteRaw |
Sprite |
byte[] image, float PixelsPerUnit = 100.0f |
Converts raw bytes to a Sprite |
LoadSpriteFromTexture |
Sprite |
Texture2D SpriteTexture, float PixelsPerUnit = 100.0f |
Converts Texture2D to a Sprite |
LoadSpriteFromFile |
Sprite |
string FilePath, float PixelsPerUnit = 100.0f |
Loads Sprite from image file |
LoadSpriteFromResources |
Sprite |
string resourcePath, float PixelsPerUnit = 100.0f |
Loads Sprite from Resource |
GetResource |
byte[] |
Assembly asm, string ResourceName |
Loads bytes of a Resource |
GetModsFolder |
string |
Gets /Mods/ folder location | |
GetWorkshopFolder |
string |
Gets workshop folder location |
Method | Returns | Arguments | Description |
---|---|---|---|
SpawnApplianceBlueprintAtPlayer |
Entity |
int id , float priceModifier = 0f , int forcePrice = -1 , bool use_red = false |
Used to spawn an Appliance Blueprint at a random player |
SpawnApplianceBlueprintAtPosition |
Entity |
int id , Vector3 position , float priceModifier = 0f , int forcePrice = -1 , bool use_red = false |
Used to spawn an Appliance Blueprint at a set position |
SpawnApplianceBlueprintAtPlayer |
Entity |
int id , float priceModifier = 0f , int forcePrice = -1 |
Used to spawn an Appliance Blueprint at a random player |
SpawnApplianceBlueprintAtPlayer<T> |
Entity |
float priceModifier = 0f , int forcePrice = -1 , bool use_red = false |
Used to spawn an Appliance Blueprint at a random player |
SpawnApplianceBlueprint |
Entity |
int id , float priceModifier = 0f , int forcePrice = -1 , bool use_red = false |
Used to spawn an Appliance Blueprint at a random position |
SpawnApplianceBlueprint<T> |
Entity |
float priceModifier = 0f , int forcePrice = -1 |
Used to spawn an Appliance Blueprint at a random position |
Method | Returns | Arguments | Description |
---|---|---|---|
GetInt32HashCode |
int |
string strText |
Used to generate an int based on a string |
Method | Returns | Arguments | Description |
---|---|---|---|
GetSystem<T> |
T |
Used to get an active ECS system |
Method | Returns | Arguments | Description |
---|---|---|---|
AddColourOverride |
void |
int unlockId , Color colour |
This is used to override the unlock color displayed on a Card |
RemoveColourOverride |
void |
int unlockId |
This is used to reverse the effect of the previous AddColourOverride |
AddIconOverride |
void |
int unlockId , string icon |
This is used to override the icon displayed on a Card |
RemoveIconOverride |
void |
int unlockId |
This is used to reverse the effect of the previous AddIconOverride |
Method | Returns | Arguments | Description |
---|---|---|---|
ViewUtils |
int |
string name |
Used to generate an int based on a string |
HexToColor |
Color |
string hex |
Get a Unity Color from a hex code |
GetInt32HashCode |
int |
string strText |
Used to generate an int based on a string |
Method | Returns | Arguments | Description |
---|---|---|---|
GetViewType |
CustomViewType |
string modId , string viewId |
Find a custom view type by mod ID and view ID |
GetViewType |
CustomViewType |
int id |
Find a custom view type by view ID |
RegisterView |
void |
ViewType viewType , Type singleston , Type component |
Registers a custom view |
RegisterView |
void |
string viewType , Type singleston , Type component |
Registers a custom view |
Method | Returns | Arguments | Description |
---|---|---|---|
GetExistingVFX |
VisualEffectAsset |
string name |
Used to find an instance of an existing VFX item |
AssignVFXByNames |
GameObject |
this GameObject gameObjet |
Iterates through all the childresn GameObjects to find anythinf prefixed with "VFX" to create a VFX instance |