public static OnlineDetector getInstance()
 {
     if (onlineDetector == null)
     {
         onlineDetector = new OnlineDetector();
     }
     return(onlineDetector);
 }
        static void Main(string[] args)
        {
            GlobalConstant.initializeConstants("init.txt");

            onlineDetector = OnlineDetector.getInstance();

            gesturesDetector = GesturesDetector.getInstance();

            Actions actions = Actions.getInstance();

            actions.initializeMSRDatasetActionsArray();

            connectWithUnity = true;

            asyncClientSocket = new AsynchronousClient();
            if (connectWithUnity)
            {
                Console.WriteLine("Connecting with Unity.");
                while (!asyncClientSocket.canOpenSocketAndConnect())
                {
                    ;
                }
                initializeGameState();
                Console.WriteLine("Connection Opened With Unity.");
            }

            if (FROM_FILE)
            {
                Console.WriteLine("\nWorking from file. Pls w8, This will take a bit to run.");
                setJointsIdsMap();
                loadFromFile();
            }
            else
            {
                connectKinect();
                Console.WriteLine("Kinect Connected!");
                Console.ReadLine();
                closeKinectConnections();
            }


            Console.WriteLine("\nProgram Fininshed, Press any key to exit.");
            Console.ReadLine();
        }