to make sure your types get serialized correctly you need to make use of the `[JsonPolymorphic]` and `[JsonDerivedType]` attributes. And for the latter make sure to set a typeDiscirimnator or it wil not work !!!!
EXAMPLE CODE
[GameResource( "Quest", "quest", "A quest given to the user !", Category = "quest" )]
public class Quest : GameResource
{
[Property,InlineEditor,TypeSelector] public TaskBase Task { get; set; }
}
//The two attributes here are from .net
[JsonPolymorphic]
[JsonDerivedType( typeof(Collect), "Collect" )] // Yeah you have to do this for every type. blame C#, not me.
public abstract class TaskBase //Because this class is abstract it will not showup in the menu.
{
[Property] public string QuestName {get;set};// all types will show this
}
public class Collect : TaskBase
{
[Property] public int AmountToCollect {get;set;}
}
public class TalkTo : TaskBase
{
[Property] public GameObject Target {get;set;}
}
TODO
☐ Search functionality in the menu
No usage statistics available
This package may be new or not widely used yet. Usage data becomes available as more users install and play with the package.
emoji_events
No achievements available
This package doesn't have any achievements defined.
This file manifest and asset metadata are retrieved live directly from the official Facepunch s&box public API.
s&box Explorer does not host, store, or redistribute any package files. All download links route directly to Facepunch CDN servers.
visibility_off
Manifest Hidden Upon Request
The file manifest for thedimin.typeselect has been hidden from public display upon verified request by the creator or copyright holder under our DMCA & Content Privacy policy.
If you are the creator and wish to adjust this status, contact [email protected].
folder_off
No Manifest Available
File manifest data is currently not available for this package.
inventory_2
0Total Files
hard_drive
0 MBUncompressed Size
terminal
-Engine Version
search
Showing 0 of 0 files
File Path
Size
CRC / Hash
Download
shield
Request Manifest Withholding
Open a pre-addressed removal request to [email protected] with package details pre-filled: