We are working on a non-game warehouse simulator which needs a dumb terminal interface to access an external stock management system.
We need to access this interface from within our Unity project.
Although we could attempt to build a freestanding app with a global floating window to sit on top of our Unity app it would be wonderful if we could somehow build a terminal emulator into our Unity project.
Can anyone see a way of building a Terminal Emulator into a Unity project?
Which terminal do you want to emulate? VT100, 3270, 5250? Some terminals are ASCII, but most are EBCDIC. While most of it is achievable as the protocols are thoroughly documented, I doubt you’ll be able to hook unity into a twinax adapter to actually talk to a midrange/mainframe.
If it’s not true terminal emulation you’re after, but just a telnet type interface talking through a socket you opened then that’s a piece of cake.
They’re usually fixed width 80 or 132 columns. This makes your job of parsing the data a bit easier, as you can use an array to effect line wrap, moving the cursor about and such. You then simply construct a series of gui labels in your window, one for each line of the resulting array.
Scrolling regions might be a bit more complicated, but still doable.
The thing is though, do you really need to emulate the terminal, or just retrieve the data from a socket you open and use that within your non-game? Maybe if it’s true terminal emulation you want, it would be better just to have Unity launch an external app when appropriate. You could always use the shell to pipe the output to a file and have Unity read that.