나는 두 개의 CCScenes
을 가지고 있는데 A와 B라고 부르 자. 내가 장면 A에있을 때 비디오 플레이어로 UIViewController
인스턴스를 제시한다. 그리고 나는 장면 B. 해당의 UIViewController에서 이동하려는입니다 내가 어떻게 그 :UIViewController가 표시되는 동안 CCScene을 바꾸는 방법은 무엇입니까?
- (void)videoFinished:(NSNotification *)notification
{
[self presentCurrentActivity];
id object = notification.object;
if ([notification.name isEqualToString:AVPlayerItemDidPlayToEndTimeNotification])
[RAActivityInfoManager setVideoWatched];
[[NSNotificationCenter defaultCenter] removeObserver:self name:AVPlayerItemDidPlayToEndTimeNotification object:object];
[[NSNotificationCenter defaultCenter] removeObserver:self name:VIDEO_SKIPPED_NOTIFICATION object:nil];
[[CCDirector sharedDirector] dismissViewControllerAnimated:YES completion:nil];
}
- (void)presentCurrentActivity
{
if (currentActivity >= numberOfActivitiesInLesson)
currentActivity = 1;
NSString *className = self.activityNames[currentActivity];
Class class = NSClassFromString(className);
[RAActivityInfoManager addSpriteFramesForClass:class];
SEL selector = sel_registerName("scene");
CCScene *scene = [class performSelector:selector];
[[CCDirector sharedDirector] replaceScene:scene];
}
난 내 UIViewController
기각 후 장면 B의 오른쪽에 얻을 것입니다 필요로하는 모든. 그러나 불행히도 그것은 항상 장면 A로 순간 이동하고 그 후에 장면 B가 나타납니다. 마찬가지로 지금까지 UIViewController
블록 Cocos2D
보여주는 이해해야 viewController가 제거 된 후에 만 행동 할 수 CCDirector
. 그래서 CCScene
을 비동기 적으로 대체하는 방법을 찾아야합니다. 반면에 viewController는 여전히 켜져 있습니다. 어떤 아이디어?