Hi, I just add my own custom field type and it has shown in the dialogue editor as expected.
now I need to check whether the field I'm getting is having the same field type.
The Field class has a member 'type' which will give me the information of target field's type.
It is an Enum, and of course the enum list dose not contain my custom field type, unless I add one into the list.
Base on my understanding, It would be unwise to modify any of the code within Dialogue System, otherwise in the future update all my modification will lost.
So...what will be the best way to check whether the target type is my custom field type??
How to check whether field type is your custom field type?
Re: How to check whether field type is your custom field type?
Hi,
If you have a Field object, its typeString property will be the name of your custom field type class.
For example, the Dialogue System Extras page has a custom field type named "CustomFieldType_Asset" that lets you assign assets (sprites, audio clips, etc.) to a field. To check if a field is this type:
If you have a Field object, its typeString property will be the name of your custom field type class.
For example, the Dialogue System Extras page has a custom field type named "CustomFieldType_Asset" that lets you assign assets (sprites, audio clips, etc.) to a field. To check if a field is this type:
Code: Select all
bool isAssetFieldType = someField.typeString == nameof(CustomFieldType_Asset);
Re: How to check whether field type is your custom field type?
Thank you for the reply!