From 7a59f9a2a19d7cf445bb5953665483bdc445482f Mon Sep 17 00:00:00 2001 From: Sinai Date: Sun, 20 Jun 2021 19:10:32 +1000 Subject: [PATCH] Update info about startup script -noci --- README.md | 1 + src/UI/CSConsole/ConsoleController.cs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 36c0ed3..5db68e2 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,7 @@ The inspector is used to see detailed information on objects of any type and man ### C# Console * The C# Console uses the `Mono.CSharp.Evaluator` to define temporary classes or run immediate REPL code. +* You can execute a script automatically on startup by naming it `startup.cs` and placing it in the `UnityExplorer\Scripts\` folder (this folder will be created where you placed the DLL file). * See the "Help" dropdown in the C# console menu for more detailed information. ### Mouse-Inspect diff --git a/src/UI/CSConsole/ConsoleController.cs b/src/UI/CSConsole/ConsoleController.cs index 3c88e1b..ce911af 100644 --- a/src/UI/CSConsole/ConsoleController.cs +++ b/src/UI/CSConsole/ConsoleController.cs @@ -608,7 +608,9 @@ If the game was built with Unity's stubbed netstandard 2.0 runtime, you can fix internal const string STARTUP_TEXT = @"// Welcome to the UnityExplorer C# Console! // It is recommended to use the Log panel (or a console log window) while using this tool. -// Use the Help dropdown to see detailed examples of how to use the console."; +// Use the Help dropdown to see detailed examples of how to use the console. + +// To execute a script automatically on startup, put the script at 'UnityExplorer\Scripts\startup.cs'"; internal const string HELP_USINGS = @"// You can add a using directive to any namespace, but you must compile for it to take effect. // It will remain in effect until you Reset the console.