u-terminal (source code included)
u-terminal free (assembly version)
1.Summary 2.Unity Version 3.Features 4.Example of use 5.Example of Command Definition 6.Configuration 7.Sliding controller 8.javascript
u-Terminal is like a terminal in Unix, a console in Windows, and a console window in FPS games.
Provides a REPL environment for receiving user input and outputting results.
2018.4.27f1 and later 2019.4.10f1 and later 2020.1.6f1 and later
comp ls /GameObject
config audio.pause true
date --locale ko-KR --utc
obj ls / --recursive
exit
info productName
resolution --full
scene --list
version
Base command definition
[CommandSummary("Exit the application.")]
public class ExitCommand : TerminalCommandBase
{
public ExitCommand(ITerminal terminal)
: base(terminal)
{
}
[CommandPropertyRequired(DefaultValue = 0)]
[CommandSummary("Specifies the exit code. The default is 0.")]
public int ExitCode { get; set; }
protected override void OnExecute()
{
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#else
UnityEngine.Application.Quit();
#endif
}
}
Base usage
Register field information to be used as configuration
public class TestConfiguration : MonoBehaviour
{
[SerializeField]
private float value = 0;
[SerializeField]
private ConfigurationSystem configSystem = null;
private void Awake()
{
if (this.configSystem != null)
{
this.configSystem.AddConfig(new FieldConfiguration("test.value", this, nameof(value)) { DefaultValue = this.value });
}
}
}
How to use configurations in a terminal
default key : ctrl + `
javascript content is not included in the asset.
The figure below is implemented using the jint library.