- Home /
communicate with standalone from php or command line
Is it possible to communicate with a unity standalone while it's running. For instance I want to check a variable in the standalone from the command line and receive a response. I've seen some examples of sending command line arguments to a standalone on startup and have got those working, but I do not know how to communicate from the command line or php to the standalone while it's running.
In the standalone I have:
import System;
function Start () {
var Data:String[]=Environment.GetCommandLineArgs();
for(var i=0;i<Data.length;i++){
Debug.Log(Data[i]);
}
}
The command to start the standalone is pathtostandalone arg1=1 arg2=2 I'm using it in php but it also works from the command line.
echo exec('pathtostandalone arg1=1 arg2=2',$output,$retval);
(Note the pathtostandalone on mac was the path to the standalone and then adding /Contents/MacOS/standalonename and not just the path to the standalone.)
Is it possible to check a standalone variable from the command line or php?