added yarn spinner package

This commit is contained in:
2026-08-14 13:27:17 +02:00
parent c140236bf7
commit c483bda3ea
573 changed files with 81459 additions and 0 deletions
@@ -0,0 +1,20 @@
namespace Yarn.Unity
{
class PrepareBuild : UnityEditor.Build.BuildPlayerProcessor
{
public override void PrepareForBuild(UnityEditor.Build.BuildPlayerContext buildPlayerContext)
{
// This is called immediately before building starts. We calculate the
// current version of the Yarn Spinner assembly, write it to a JSON file
// somewhere on disk, and tell Unity to include that file with a given
// name in the StreamingAssets folder inside the build.
var version = typeof(DialogueRunner).Assembly.GetName().Version;
var jsonText = $@"{{""note"":""This file exists to help us see which games are using Yarn Spinner. If you don't want it in your build, you can safely delete it."",""version"": ""{version}""}}";
var path = System.IO.Path.GetTempFileName();
System.IO.File.WriteAllText(path, jsonText);
buildPlayerContext.AddAdditionalPathToStreamingAssets(path, "YarnSpinnerVersion.json");
}
}
}