communicating with external linux application
I want to run my Unity application on Linux as a standalone. I am done with the project and its working flawlessly in Linux. The issue am facing is to make unity application communicate with an external application. What I want to do here is, I have an application on my Linux machine which i want to use for, to make a call to a function in Unity standalone application, So that when the function is called the Unity application comes to the front and executes with the values of those parameters. And once the Unity application is done with its operation, it minimizes it self and makes a call to that Linux application. I have no idea how to send are receive messages through external applications, to unity application to that unity application can work.
Please help, And also i need help with minimizing and maximizing of unity standalone application.
Answer by See_Sharp · Mar 03, 2016 at 08:25 AM
You could set up a TCP socket to communicate with other programs. I'm also currently doing this with a python script that runs in the background.
As for minimizing or maximizing on linux, If the .net windows code doesn't work, you could download a bash script that does such function. Copy paste it into your resource folder and execute the bash script from your C#/script :)
Ps: sorry for not providing any links, I'm on my phone and when I switch tabs this page gets refreshed, writing this the 3th time lol
Goodluck ;)
EDIT:
Run bash script from C# example: /$ cat /tmp/bash.sh #!/bin/bash echo "bla $1" / using System; using System.Diagnostics;
class Runshell
{
static void Main()
{
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "/tmp/bash.sh";
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.Arguments = "test";
Process p = Process.Start(psi);
string strOutput = p.StandardOutput.ReadToEnd();
p.WaitForExit();
Console.WriteLine(strOutput);
}
As for the bash script to minimize or maximize, i just hit google:
http://askubuntu.com/questions/4876/can-i-minimize-a-window-from-the-command-line
Hi, Thanks
I'll try it out and will get back to you.
Your answer
Follow this Question
Related Questions
Linux Standalone player slow startup after version 5.2 0 Answers
How can I show a prompt for the user when my standalone application crashes? 0 Answers
Launching Windows apps from Unity 0 Answers
Standalone player giving "is not responding" dialog after first scene load on Ubuntu 2 Answers
Send a message from unity standalone application to a java application on linux? 1 Answer