The various .Find methods will return null if not found.
For example, something we do to change the recipe icon color to red if the user can't create a given crafting recipe:
var recipe = ORK.CraftingRecipes.Find(parsedRecipeName.text); if (recipe != null) { var color = recipe.Settings.CanCreate(ORK.Menu.GetMenuUser()) ? Color.white : Color.red;
Find method is for finding by name, for GUIDs you simply need to use a Get method and check if it returns null, e.g.: Item item = ORK.Items.Get("YOURGUID"); if(item != null) // valid
Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found. If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
For example, something we do to change the recipe icon color to red if the user can't create a given crafting recipe:
var recipe = ORK.CraftingRecipes.Find(parsedRecipeName.text);
if (recipe != null)
{
var color = recipe.Settings.CanCreate(ORK.Menu.GetMenuUser()) ? Color.white : Color.red;
parsedRecipeIcon.color = color;
}
Item item = ORK.Items.Get("YOURGUID");
if(item != null) // valid
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!