Skip to content

Instantly share code, notes, and snippets.

View JoneWang's full-sized avatar
🏠
Working at home

Jone Wang JoneWang

🏠
Working at home
View GitHub Profile
@desplesda
desplesda / RuntimeLoading.cs
Created March 8, 2021 03:23
Sample code for runtime compilation and loading of Yarn scripts in Yarn Spinner 1
class Demo : MonoBehaviour {
public DialogueRunner dialogueRunner;
private void LoadYarnFilesAndRun(string sourceFilesDirectoryPath)
{
Debug.Log($"Compiling and loading Yarn files in {sourceFilesDirectoryPath}");
var yarnFiles = Directory.EnumerateFiles(sourceFilesDirectoryPath, "*.yarn")
.Concat(Directory.EnumerateFiles(sourceFilesDirectoryPath, "*.yarn.txt"))