Esempio n. 1
0
        public void Run()
        {
            try
            {
                bool test = xEngine_test(true);

                UnityContainer.Get().Engine = new EngineBase(CPointer = xEngine_create(Title, ResourceConfigFile));

                CreateStateCallback createStateCallback =
                    (newState) =>
                {
                    //create State
                    _currentState = new GameState(newState);
                    // Console.WriteLine("Progress = {0}", value);
                };

                MainLoopBeforeUpdateCallback beforeUpdateCallback =
                    (deltaTime) =>
                {
                    BeforeUpdate(deltaTime);
                    // Console.WriteLine("Progress = {0}", value);
                };

                MainLoopAfterUpdateCallback afterUpdateCallback =
                    (deltaTime) =>
                {
                    AfterUpdate(deltaTime);
                    // Console.WriteLine("Progress = {0}", value);
                };


                xEngine_run(CPointer, createStateCallback, beforeUpdateCallback
                            , afterUpdateCallback); //-> calls create state callback on c side
            }
            catch (Exception ex)
            {
            }
        }
Esempio n. 2
0
 static extern unsafe void xEngine_run(IntPtr CPointer, CreateStateCallback callbackPointer, MainLoopBeforeUpdateCallback beforeUpdateCallbackPointer, MainLoopAfterUpdateCallback afterUpdateCallbackPointer);