When using cocos3d with iOS UIKit's views there is constant need to pause and start it - for example, when showing modal view over EAGLView.
In my MainViewController, which contains view with EAGLView, I use reference counting for that:
- (void) startDirector
{
_directorStartCount++;
if(_directorStartCount == 1)
{
LogInfo(@"%@", @"CCDirector started.");
[[CCDirector sharedDirector] startAnimation];
}
}
- (void) stopDirector
{
_directorStartCount--;
if(_directorStartCount == 0)
{
LogInfo(@"%@", @"CCDirector stopped.");
[[CCDirector sharedDirector] stopAnimation];
}
}
I suggest to incorporate it into CCDirector itself, or inherit CC3Director from it and implement that reference counting in it.
After all, consistent and comfortable work with native iOS UI is one of main advantages of cocos3d over engines like Unity.