Custom Crops are actually custom items, the item created is a seed that is planeted in a farm plot and grows the custom crops.
Creating Crops
To create a custom crop, create a class that overrides CustomCrop:
CustomCrop support the following overrides:
Type
Name
Default
List<InventoryItem.ITEM_TYPE>
HarvestResult
REQUIRED
List<Sprite>
CropStates
[]
float
CropGrowthTime
9f
float
PickingTime
2.5f
Vector2Int
CropCountToDropRange
(3,4)
string
HarvestText
”Pick <color=#FD1D03>Berries”
Custom Crops also support all overrides available for Custom Items.
Adding Crops
To add a custom crop into the game, simply use CustomItemManager.Add(CustomCrop crop).
Example:
Assigning the result of CustomItemManager.Add() allows you to reference that crop elsewhere in your code using Plugin.ExampleSeed.
Final Steps
For the icon to load, you need to put it in the appropriate location. For the example, this would be /Assets/example_seed.png relative to the root folder containing the .dll
Directory structure: