本文整理汇总了C#中CocosSharp.CCWindow.AddSceneDirector方法的典型用法代码示例。如果您正苦于以下问题:C# CCWindow.AddSceneDirector方法的具体用法?C# CCWindow.AddSceneDirector怎么用?C# CCWindow.AddSceneDirector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CocosSharp.CCWindow
的用法示例。
在下文中一共展示了CCWindow.AddSceneDirector方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplicationDidFinishLaunching
public override void ApplicationDidFinishLaunching (CCApplication application, CCWindow mainWindow)
{
GameAppDelegate.mainWindow = mainWindow;
director = new CCDirector ();
application.PreferMultiSampling = false;
application.ContentRootDirectory = "Content";
application.ContentSearchPaths.Add ("animations");
application.ContentSearchPaths.Add ("fonts");
application.ContentSearchPaths.Add ("images");
application.ContentSearchPaths.Add ("levels");
application.ContentSearchPaths.Add ("sounds");
CCSize windowSize = mainWindow.WindowSizeInPixels;
// Use the SNES resolution:
float desiredWidth = 256.0f;
float desiredHeight = 224.0f;
CCScene.SetDefaultDesignResolution (desiredWidth, desiredHeight, CCSceneResolutionPolicy.ShowAll);
mainWindow.AddSceneDirector (director);
var scene = new LevelSelectScene (mainWindow);
// Can skip to the GmameScene by using this line instead:
//var scene = new GameScene(mainWindow);
director.RunWithScene (scene);
}
示例2: ApplicationDidFinishLaunching
public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
{
GameAppDelegate.mainWindow = mainWindow;
application.PreferMultiSampling = false;
application.ContentRootDirectory = "Content";
application.ContentSearchPaths.Add ("Entity");
application.ContentSearchPaths.Add ("fonts");
application.ContentSearchPaths.Add ("images");
application.ContentSearchPaths.Add ("Level");
application.ContentSearchPaths.Add ("Sound");
application.ContentSearchPaths.Add ("ViewsImage");
float desiredHeight = 768.0f;
float desiredWidth = 1024.0f;
CCScene.SetDefaultDesignResolution (desiredWidth, desiredHeight, CCSceneResolutionPolicy.ShowAll);
director = new CCDirector ();
mainWindow.AddSceneDirector (director);
var scene = new SplashScene (mainWindow);
director.RunWithScene (scene);
scene.PerformSplash ();
CCSimpleAudioEngine.SharedEngine.PlayBackgroundMusic ("SplashBackMusic.wav",false);
CCSimpleAudioEngine.SharedEngine.PreloadEffect ("BallCollideHigh.wav");
CCSimpleAudioEngine.SharedEngine.PreloadEffect ("BallCollideLow.wav");
CCSimpleAudioEngine.SharedEngine.PreloadEffect ("ballCollideBrick.wav");
}
示例3: ApplicationDidFinishLaunching
public override void ApplicationDidFinishLaunching (CCApplication application, CCWindow mainWindow)
{
GameAppDelegate.mainWindow = mainWindow;
director = new CCDirector ();
application.PreferMultiSampling = false;
application.ContentRootDirectory = "Content";
application.ContentSearchPaths.Add ("animations");
application.ContentSearchPaths.Add ("fonts");
application.ContentSearchPaths.Add ("images");
application.ContentSearchPaths.Add ("levels");
application.ContentSearchPaths.Add ("sounds");
#if __IOS__
application.ContentSearchPaths.Add ("sounds/iOS/");
#else // android
application.ContentSearchPaths.Add("sounds/Android/");
#endif
CCSize windowSize = mainWindow.WindowSizeInPixels;
// Use the SNES resolution:
float desiredWidth = 256.0f;
float desiredHeight = 224.0f;
CCScene.SetDefaultDesignResolution (desiredWidth, desiredHeight, CCSceneResolutionPolicy.ShowAll);
mainWindow.AddSceneDirector (director);
CCSimpleAudioEngine.SharedEngine.PlayBackgroundMusic("CoinTimeSong", loop: true);
// Make the audio a little quieter:
CCSimpleAudioEngine.SharedEngine.EffectsVolume = .3f;
var scene = new LevelSelectScene (mainWindow);
// Can skip to the GmameScene by using this line instead:
//var scene = new GameScene(mainWindow);
director.RunWithScene (scene);
}
示例4: ApplicationDidFinishLaunching
//游戏运行时第一个运行这个
public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
{
GameAppDelegate.mainWindow = mainWindow;
//CCDirector是处理scene这一级别的
//导演
director = new CCDirector ();
//手机游戏开发时,要把PreferMultiSampling设为false
//因为手机处理器不够强大
//这个抗锯齿算法很费cpu
application.PreferMultiSampling = false;
//asset的读取地址
application.ContentRootDirectory = "Content";
application.ContentSearchPaths.Add ("animations");
application.ContentSearchPaths.Add ("fonts");
application.ContentSearchPaths.Add ("images");
application.ContentSearchPaths.Add ("levels");
application.ContentSearchPaths.Add ("sounds");
CCSize windowSize = mainWindow.WindowSizeInPixels;
// Use the SNES resolution:
//设置游戏画面的大小
float desiredWidth = 256.0f;
float desiredHeight = 224.0f;
CCScene.SetDefaultDesignResolution (desiredWidth, desiredHeight, CCSceneResolutionPolicy.ShowAll);
//加入导演
mainWindow.AddSceneDirector (director);
//导演引入第一个scene
var scene = new LevelSelectScene (mainWindow);
director.RunWithScene (scene);
}
示例5: CCScene
public CCScene(CCWindow window, CCViewport viewport, CCDirector director = null)
#endif
{
IgnoreAnchorPointForPosition = true;
AnchorPoint = new CCPoint(0.5f, 0.5f);
Viewport = viewport;
Window = window;
Director = (director == null) ? window.DefaultDirector : director;
if (window != null && director != null)
window.AddSceneDirector(director);
#if USE_PHYSICS
_physicsWorld = physics ? new CCPhysicsWorld(this) : null;
#endif
SceneResolutionPolicy = window.DesignResolutionPolicy;
}