Unity3D samples

Forum for development eye controlled Unity 3D applications

Unity3D samples

Postby a.vourvopoulos » 17 Jan 2014, 16:59

Are there any available Unity3d samples?
Even in a primitive stage...

Thanks.
a.vourvopoulos
 
Posts: 6
Joined: 16 Jan 2014, 18:17

Re: Unity3D samples

Postby Martin » 17 Jan 2014, 19:06

Yes! Working on it, hope to release next week but no firm promise on it.
Martin
 
Posts: 567
Joined: 29 Oct 2013, 15:20

Re: Unity3D samples

Postby a.vourvopoulos » 17 Jan 2014, 20:46

Martin wrote:Yes! Working on it, hope to release next week but no firm promise on it.


That's great, thanks!

I think Unity doesn't support Newtonsoft for de/serialising the data and I had some problems on that.
i plannig to use LitJson http://lbv.github.io/litjson/ :/
a.vourvopoulos
 
Posts: 6
Joined: 16 Jan 2014, 18:17

Re: Unity3D samples

Postby Martin » 28 Jan 2014, 02:54

Came across a project on Github today by Rich Stoner:
https://github.com/richstoner/unofficial-eyetribe-unity3d

A similar sample from us is coming as well.
Martin
 
Posts: 567
Joined: 29 Oct 2013, 15:20

Re: Unity3D samples

Postby a.vourvopoulos » 28 Jan 2014, 19:44

Martin wrote:Came across a project on Github today by Rich Stoner:
https://github.com/richstoner/unofficial-eyetribe-unity3d

A similar sample from us is coming as well.


Thanks, i will give it a try.
I guess it includes only a client so I have to run the EyeTribe server externaly :?
a.vourvopoulos
 
Posts: 6
Joined: 16 Jan 2014, 18:17

Re: Unity3D samples

Postby Martin » 30 Jan 2014, 15:14

We just published our first Unity sample on GitHub, it's using the CSharpClient.

Image

The server runs standalone. You could potentially check if it's not running and start it using the standard .Net Process.Start() (this is how we do it for the EyeTribeUI)
Martin
 
Posts: 567
Joined: 29 Oct 2013, 15:20

Re: Unity3D samples

Postby a.vourvopoulos » 30 Jan 2014, 19:07

That's cool, thanks!
a.vourvopoulos
 
Posts: 6
Joined: 16 Jan 2014, 18:17

Re: Unity3D samples

Postby john » 03 Mar 2014, 15:36

Martin wrote:...
The server runs standalone. You could potentially check if it's not running and start it using the standard .Net Process.Start() (this is how we do it for the EyeTribeUI)


Hi Martin,

For Process.Start(), do you give the url to the full install path or do you include a copy of the server exe with the project and call it with a relative path (or something else)? I wanted to implement this feature in a Unity project, but am wondering whether the full install path method would be consistent between users or if there is any problem with including the server exe inside the project. Do you have a snippet to share from your implementation?

Here is my version, which uses the full URL path, but I'm still wondering if there is a better approach.

Code: Select all
        //check whether the tet server process is running and start it if needed
        string tetProcessName = "EyeTribe"; //name of tet server process
        string tetProcessExe = @"C:\Program Files (x86)\EyeTribe\Server\EyeTribe.exe"; //exe path
        bool tetProcessRunning = false; //flag to check whether tet server is already running
        Process[] allProcesses = Process.GetProcesses(); //store any running processes
        //loop through processes to find tet server
        foreach (Process theProcess in allProcesses) {
            try {
                if (theProcess.ProcessName == tetProcessName) {
                    //toggle flag
                    tetProcessRunning = true;
                    UnityEngine.Debug.Log("TET Server already running");
                }
            }
            //ignore any processes that Unity can't access
            catch (System.InvalidOperationException theException) {
                UnityEngine.Debug.Log("Process not accessible - ignore: " /*+ theException*/);
            }
        }
        //start the process if it is not running
        if (tetProcessRunning == false) {
            UnityEngine.Debug.Log("Starting TET Server");
            Process.Start(tetProcessExe);
        }


Thanks,
John
john
 
Posts: 8
Joined: 03 Jan 2014, 01:57

Re: Unity3D samples

Postby Martin » 03 Mar 2014, 17:22

Hi John,

Path to server exe can be readout from the registry like this:

Code: Select all
        private static string GetServerExecutablePath()
        {
            // Check registry for path
            string installPath = string.Empty;
           installPath = (string)Registry.GetValue(@"HKEY_CURRENT_USER\Software\EyeTribe\EyeTribe Service", "InstallDir", string.Empty);

            if (installPath != string.Empty)
                return installPath + "EyeTribe.exe";

            // Not in reg, check default paths
            const string x86 = "C:\\Program Files (x86)\\EyeTribe\\Server\\EyeTribe.exe";
            const string x64 = "C:\\Program Files\\EyeTribe\\Server\\EyeTribe.exe";

            if (File.Exists(x86))
                return x86;

            if (File.Exists(x64))
                return x64;

            return string.Empty;
        }
Martin
 
Posts: 567
Joined: 29 Oct 2013, 15:20

Re: Unity3D samples

Postby john » 04 Mar 2014, 15:52

That's great. Thanks for the code sample.
john
 
Posts: 8
Joined: 03 Jan 2014, 01:57


Return to Unity



cron