Custom class for words

12 views
Skip to first unread message

christia...@gmail.com

unread,
Feb 12, 2017, 2:09:33 AM2/12/17
to Developer Support
Is there a way to replace the Link Keyword Collection within the HyperText script to a custom class?

For example:
Replace 'fantasy people' with a custom class that has it's own database setup? The 'Entries' would just be replace with a string from each item within the custom class.

Have been searching for a way to replace those .asset unity databases within the script, but not familiar with how they are referenced, so unsure what to modify for this.

Thanks much for the help.

Developer Support

unread,
Feb 12, 2017, 5:44:55 AM2/12/17
to Developer Support
Hi there! I'm not 100% clear on what you're asking here, but:
  • If you're asking about how to set keyword collections at run-time, you should use e.g. HyperText.SetLinkKeywordCollections() or HyperText.SetTagKeywordCollections(), depending on exactly what you're after.
  • If you're wanting to create your own keyword collection types, you need to create a class that inherits from KeywordCollection. Although in hindsight the better approach here would have been to do this as an interface instead (e.g., IKeywordCollection), your custom KeywordCollection class would just be a ScriptableObject (e.g., asset) type that retrieves keywords from your database and returns them in the Keywords property. You may find the source for KeywordsGlossary and KeywordsTextDocument helpful when/if you set out to do this.
Reply all
Reply to author
Forward
0 new messages