diff --git a/Assets/uREPL/Examples/Scenes/Multi Line.unity b/Assets/uREPL/Examples/Scenes/Multi Line.unity index a826e30..e8c4e01 100644 Binary files a/Assets/uREPL/Examples/Scenes/Multi Line.unity and b/Assets/uREPL/Examples/Scenes/Multi Line.unity differ diff --git a/Assets/uREPL/Examples/Scenes/Multiple GUIs.unity b/Assets/uREPL/Examples/Scenes/Multiple GUIs.unity index 1f5a6a7..ddd6563 100644 Binary files a/Assets/uREPL/Examples/Scenes/Multiple GUIs.unity and b/Assets/uREPL/Examples/Scenes/Multiple GUIs.unity differ diff --git a/Assets/uREPL/Examples/Scenes/Runtime Command.unity b/Assets/uREPL/Examples/Scenes/Runtime Command.unity index 1a1e465..6e4dbc3 100644 Binary files a/Assets/uREPL/Examples/Scenes/Runtime Command.unity and b/Assets/uREPL/Examples/Scenes/Runtime Command.unity differ diff --git a/Assets/uREPL/Examples/Scenes/Screen Overlay.unity b/Assets/uREPL/Examples/Scenes/Screen Overlay.unity index 7e41f34..086ba90 100644 Binary files a/Assets/uREPL/Examples/Scenes/Screen Overlay.unity and b/Assets/uREPL/Examples/Scenes/Screen Overlay.unity differ diff --git a/Assets/uREPL/Examples/Scenes/Single Line.unity b/Assets/uREPL/Examples/Scenes/Single Line.unity index 76d9ca8..5503690 100644 Binary files a/Assets/uREPL/Examples/Scenes/Single Line.unity and b/Assets/uREPL/Examples/Scenes/Single Line.unity differ diff --git a/Assets/uREPL/Examples/Scenes/World Space.unity b/Assets/uREPL/Examples/Scenes/World Space.unity index 55c0050..6eaf69b 100644 Binary files a/Assets/uREPL/Examples/Scenes/World Space.unity and b/Assets/uREPL/Examples/Scenes/World Space.unity differ diff --git a/Assets/uREPL/Plugins/Mono.CSharp.3.5.dll b/Assets/uREPL/Plugins/Mono.CSharp.3.5.dll deleted file mode 100644 index 12b4ed8..0000000 Binary files a/Assets/uREPL/Plugins/Mono.CSharp.3.5.dll and /dev/null differ diff --git a/Assets/uREPL/Plugins/Mono.CSharp.4.x.dll.meta b/Assets/uREPL/Plugins/Mono.CSharp.4.x.dll.meta deleted file mode 100644 index e1367b0..0000000 --- a/Assets/uREPL/Plugins/Mono.CSharp.4.x.dll.meta +++ /dev/null @@ -1,108 +0,0 @@ -fileFormatVersion: 2 -guid: cfe71733db60745739167e28520b3a3e -timeCreated: 1510073810 -licenseType: Pro -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Editor: 1 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - DefaultValueInitialized: true - OS: AnyOS - - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: x86 - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: x86_64 - - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: OSXIntel - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Standalone: OSXIntel64 - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/uREPL/Plugins/Mono.CSharp.4.x.dll b/Assets/uREPL/Plugins/Mono.CSharp.dll similarity index 100% rename from Assets/uREPL/Plugins/Mono.CSharp.4.x.dll rename to Assets/uREPL/Plugins/Mono.CSharp.dll diff --git a/Assets/uREPL/Plugins/Mono.CSharp.3.5.dll.meta b/Assets/uREPL/Plugins/Mono.CSharp.dll.meta similarity index 93% rename from Assets/uREPL/Plugins/Mono.CSharp.3.5.dll.meta rename to Assets/uREPL/Plugins/Mono.CSharp.dll.meta index 272d66f..313b835 100644 --- a/Assets/uREPL/Plugins/Mono.CSharp.3.5.dll.meta +++ b/Assets/uREPL/Plugins/Mono.CSharp.dll.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: b4338bf9c66854d31ada89c7b162f539 -timeCreated: 1510073806 +guid: cfe71733db60745739167e28520b3a3e +timeCreated: 1510073810 licenseType: Pro PluginImporter: externalObjects: {} @@ -65,7 +65,8 @@ PluginImporter: Standalone: LinuxUniversal second: enabled: 1 - settings: {} + settings: + CPU: AnyCPU - first: Standalone: OSXIntel second: @@ -82,7 +83,8 @@ PluginImporter: Standalone: OSXUniversal second: enabled: 1 - settings: {} + settings: + CPU: AnyCPU - first: Standalone: Win second: diff --git a/Assets/uREPL/Resources/uREPL/Prefabs/uREPL.prefab b/Assets/uREPL/Resources/uREPL/Prefabs/uREPL.prefab index 524a9ec..38fd133 100644 Binary files a/Assets/uREPL/Resources/uREPL/Prefabs/uREPL.prefab and b/Assets/uREPL/Resources/uREPL/Prefabs/uREPL.prefab differ diff --git a/Assets/uREPL/Scripts/Core/Evaluator.cs b/Assets/uREPL/Scripts/Core/Evaluator.cs index 6a4fac2..272b48c 100644 --- a/Assets/uREPL/Scripts/Core/Evaluator.cs +++ b/Assets/uREPL/Scripts/Core/Evaluator.cs @@ -83,19 +83,14 @@ static public CompileResult Evaluate(string code, bool autoCompleteComma = true) // eval the code using Mono. object ret = null; bool hasReturnValue = false; - - var originalOutput = Mono.MessageOutput; - var errorWriter = new System.IO.StringWriter(); bool isPartial = false; - Mono.MessageOutput = errorWriter; try { isPartial = Mono.Evaluate(code, out ret, out hasReturnValue) != null; } catch (System.Exception e) { - errorWriter.Write(e.Message); + UnityEngine.Debug.LogError(e.Message); } - Mono.MessageOutput = originalOutput; - var error = errorWriter.ToString(); + var error = Mono.lastOutput; if (!string.IsNullOrEmpty(error)) { error = error.Replace("{interactive}", ""); var lastLineBreakPos = error.LastIndexOf('\n'); @@ -106,7 +101,6 @@ static public CompileResult Evaluate(string code, bool autoCompleteComma = true) result.error = error; return result; } - errorWriter.Dispose(); if (isPartial) { result.type = CompileResult.Type.Partial; diff --git a/Assets/uREPL/Scripts/Core/Mono.cs b/Assets/uREPL/Scripts/Core/Mono.cs index d9545d6..d376d9b 100644 --- a/Assets/uREPL/Scripts/Core/Mono.cs +++ b/Assets/uREPL/Scripts/Core/Mono.cs @@ -1,22 +1,52 @@ -namespace uREPL +using System.IO; +using System.Text; + +namespace uREPL { -#if NET_4_6 +public class MonoMessageReporter : TextWriter +{ + public string lastOutput { get; private set; } + + public override void Write(string value) + { + lastOutput = value; + } + + public override void WriteLine(string value) + { + lastOutput = value; + } + + public void Reset() + { + lastOutput = ""; + } + + public override Encoding Encoding + { + get { return Encoding.Default; } + } +} static public class Mono { static global::Mono.CSharp.Evaluator evaluator; - - static public System.IO.StringWriter MessageOutput + static MonoMessageReporter reporter = new MonoMessageReporter(); + static public string lastOutput { - get { return null; } - set {} + get + { + var output = reporter.lastOutput; + reporter.Reset(); + return output; + } } static public void Initialize() { var settings = new global::Mono.CSharp.CompilerSettings(); - var printer = new global::Mono.CSharp.ConsoleReportPrinter(); + var printer = new global::Mono.CSharp.ConsoleReportPrinter(reporter); var context = new global::Mono.CSharp.CompilerContext(settings, printer); evaluator = new global::Mono.CSharp.Evaluator(context); } @@ -57,56 +87,4 @@ static public string GetUsing() } } -#else - -static public class Mono -{ - static public System.IO.TextWriter MessageOutput - { - get { return global::Mono.CSharp.Evaluator.MessageOutput; } - set { global::Mono.CSharp.Evaluator.MessageOutput = value; } - } - - static public void Initialize() - { - } - - static public void ReferenceAssembly(System.Reflection.Assembly asm) - { - global::Mono.CSharp.Evaluator.ReferenceAssembly(asm); - } - - static public object Evaluate(string input) - { - return global::Mono.CSharp.Evaluator.Evaluate(input); - } - - static public string Evaluate(string input, out object result, out bool result_set) - { - return global::Mono.CSharp.Evaluator.Evaluate(input, out result, out result_set); - } - - static public bool Run(string input) - { - return global::Mono.CSharp.Evaluator.Run(input); - } - - static public string[] GetCompletions(string input, out string prefix) - { - return global::Mono.CSharp.Evaluator.GetCompletions(input, out prefix); - } - - static public string GetVars() - { - return global::Mono.CSharp.Evaluator.GetVars(); - } - - static public string GetUsing() - { - return global::Mono.CSharp.Evaluator.GetUsing(); - } -} - -#endif - } \ No newline at end of file diff --git a/Packages/manifest.json b/Packages/manifest.json new file mode 100644 index 0000000..526aca6 --- /dev/null +++ b/Packages/manifest.json @@ -0,0 +1,4 @@ +{ + "dependencies": { + } +} diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index 508957e..9d1b43c 100644 Binary files a/ProjectSettings/EditorBuildSettings.asset and b/ProjectSettings/EditorBuildSettings.asset differ diff --git a/ProjectSettings/GraphicsSettings.asset b/ProjectSettings/GraphicsSettings.asset index ab2d76c..0eee2e5 100644 Binary files a/ProjectSettings/GraphicsSettings.asset and b/ProjectSettings/GraphicsSettings.asset differ diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index df882d3..b216fa4 100644 Binary files a/ProjectSettings/ProjectSettings.asset and b/ProjectSettings/ProjectSettings.asset differ diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index 7a6fffb..ada1fbd 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2017.2.0f3 +m_EditorVersion: 2017.3.0b11 diff --git a/ProjectSettings/UnityAdsSettings.asset b/ProjectSettings/UnityAdsSettings.asset deleted file mode 100644 index 62d2ede..0000000 Binary files a/ProjectSettings/UnityAdsSettings.asset and /dev/null differ