-
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatic linking codegen can now be controlled via the YS settings.
Had to make a bunch of changes to a bunch of files and also add MiniJSON. This is because the codegen pipeline can't use the Unity side of things so the built in JSON stuff is out. Pretty much everything else is just some minor refactoring to make it less all jumbled together into a single file.
- Loading branch information
Showing
10 changed files
with
885 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
using System; | ||
#if UNITY_EDITOR | ||
using UnityEditor; | ||
using UnityEngine; | ||
#endif | ||
|
||
namespace Yarn.Unity | ||
{ | ||
public interface ILogger : IDisposable | ||
{ | ||
void Write(object obj); | ||
void WriteLine(object obj); | ||
} | ||
|
||
public class FileLogger : ILogger | ||
{ | ||
System.IO.TextWriter writer; | ||
|
||
public FileLogger(System.IO.TextWriter writer) | ||
{ | ||
this.writer = writer; | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
writer.Dispose(); | ||
} | ||
|
||
public void Write(object text) | ||
{ | ||
writer.Write(text); | ||
} | ||
|
||
public void WriteLine(object text) | ||
{ | ||
writer.WriteLine(text); | ||
} | ||
} | ||
|
||
public class UnityLogger : ILogger | ||
{ | ||
public void Dispose() { } | ||
|
||
public void Write(object text) | ||
{ | ||
WriteLine(text); | ||
} | ||
|
||
public void WriteLine(object text) | ||
{ | ||
#if UNITY_EDITOR | ||
Debug.LogWarning(text.ToString()); | ||
#endif | ||
} | ||
} | ||
|
||
public class NullLogger : ILogger | ||
{ | ||
public void Dispose() { } | ||
|
||
public void Write(object text) { } | ||
|
||
public void WriteLine(object text) { } | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.