Search in sources :

Example 1 with NSAction

use of cli.MonoTouch.Foundation.NSAction in project playn by threerings.

the class IOSPlatform method willTerminate.

private void willTerminate() {
    // let the app know that we're terminating
    onExit();
    // terminate our lifecycle observers
    for (NSObject obs : lifecycleObservers) {
        NSNotificationCenter.get_DefaultCenter().RemoveObserver(obs);
    }
    lifecycleObservers.clear();
    // wait for the desired interval and then terminate the GL and AL systems
    NSTimer.CreateScheduledTimer(config.timeForTermination, new NSAction(new NSAction.Method() {

        @Override
        public void Invoke() {
            // stop the GL view
            gameView.Stop();
            // stop and release the AL resources (if audio was ever initialized)
            if (audio != null)
                audio.terminate();
            // clear out the platform in order to make sure the game creation flow can be repeated when
            // it is used as a part of a larger application
            PlayN.setPlatform(null);
        }
    }));
}
Also used : NSObject(cli.MonoTouch.Foundation.NSObject) NSAction(cli.MonoTouch.Foundation.NSAction)

Aggregations

NSAction (cli.MonoTouch.Foundation.NSAction)1 NSObject (cli.MonoTouch.Foundation.NSObject)1