inkle / ink-unity-integration

Unity integration for the open source ink narrative scripting language.
http://www.inklestudios.com/ink
Other
570 stars 99 forks source link

Fix #133: Included files without ink ext #149

Closed fantabulous-tech closed 3 years ago

fantabulous-tech commented 3 years ago

Even though vanilla Ink supports INCLUDE files without .ink extensions just fine, the Unity integration doesn't. The integration currently expects all included files to end in .ink, but to help our writers, we've removed extensions from all but the top-level .ink files so they don't open the incorrect files.

This pull request supports adding any missing INCLUDE files to the Ink Library as the top-level .ink files are being processed and a static IsInkFile(string path) function that is used wherever paths are checked. This also allows the files without .ink extensions to appear with their proper icons in the Project window.

To help test this in the future, I've added a Child Without Extension file and included it in the existing Includes/Master.ink test file.

image

There are also some additional null checks and a delayCall included to avoid errors when the editor is first opening and the library might not be built yet. (It came up as an issue with our automated build server.)

Note: This fixes Issue #133

fantabulous-tech commented 3 years ago

Ah, this should fix #133 btw.

tomkail commented 3 years ago

Thank you!