我尝试在我的第一个 cocossharp 游戏中编写启动画面,就像在 android 应用程序中编写启动画面一样。但是,它显示一个黑屏,然后直接进入游戏场景。那么我应该改变什么?非常感谢!
public class SplashScene : CCScene
{
CCSprite splashImage1;
CCSprite splashImage2;
CCLayer splashLayer;
public SplashScene (CCWindow mainWindow) : base(mainWindow)
{
splashLayer = new CCLayer ();
this.AddChild (splashLayer);
splashImage1 = new CCSprite ("Splash1");
splashImage1.Position = ContentSize.Center;
splashImage1.IsAntialiased = false;
splashImage2 = new CCSprite ("Splash2");
splashImage2.Position = ContentSize.Center;
splashImage2.IsAntialiased = false;
}
public void PerformSplash()
{
splashLayer.AddChild (splashImage1);
Thread.Sleep(3000);
splashLayer.RemoveChild(splashImage1);
splashLayer.AddChild (splashImage2);
Thread.Sleep(2000);
splashLayer.RemoveChild (splashImage2);
GameAppDelegate.GoToGameScene ();
}
}