本文整理汇总了C#中Scene.Start方法的典型用法代码示例。如果您正苦于以下问题:C# Scene.Start方法的具体用法?C# Scene.Start怎么用?C# Scene.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scene
的用法示例。
在下文中一共展示了Scene.Start方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SceneEnded
//This is called when a scene has ended, to notify the scene manager that a new scene needs to be loaded.
public void SceneEnded(/*Player Hero*/)
{
if (sceneQueue.Count > 0)
{
this.Components.Remove(currentScene);
currentScene = sceneQueue.Dequeue();
this.Components.Add(currentScene);
currentScene.Start();
}
}
示例2: Initialize
/// <summary>
/// Allows the game to perform any initialization it needs to before starting to run.
/// This is where it can query for any required services and load any non-graphic
/// related content. Calling base.Initialize will enumerate through any components
/// and initialize them as well.
/// </summary>
protected override void Initialize()
{
// TODO: Add your initialization logic here
Window.Title = "The End Of All Things";
base.Initialize();
//Define the string arrays for the narration scenes.
String[] narrationStringSet1 = {"Initiating XVR-57 Neuropsychic Conduit fire test.",
"Void Fiber link set to 10% capacity.",
"YT-4 Target Drones set to swarm attack mode.",
"",
"Test subject will use the XVR-57 to clear the field",
"of all drones."};
String[] narrationStringSet2 = {"WARNING: Results indicate that sustained use of the XVR-57 at",
"high Void Fiber link capacities will result in rapid widespread",
"organ necrosis in the wielder, leading to death.",
"",
"RECOMMENDATION: The XVR-57 project should be terminated",
"immediately. All records pertaining to the project should be",
"classified above top secret, and the prototype should be",
"transferred to the secure archive for permanent storage,",
"along with all associated artifacts and documentation."};
//Initialize the scene queue, load it up, dequeue the first scene, and start.
sceneQueue = new Queue<Scene>();
sceneQueue.Enqueue(new NarrationScene(Content, narrationStringSet1, true, spriteBatch, GraphicsDevice, this, this));
sceneQueue.Enqueue(new GameScene(tickInterval, Content, spriteBatch, GraphicsDevice, this, this));
sceneQueue.Enqueue(new NarrationScene(Content, narrationStringSet2, false, spriteBatch, GraphicsDevice, this, this));
currentScene = sceneQueue.Dequeue();
this.Components.Add(currentScene);
currentScene.Start();
}
示例3: RestartScene
public void RestartScene(Scene scene)
{
scene.Stop();
scene.Start();
}
示例4: Start
public bool Start(Simian simian)
{
m_scenes = new Dictionary<UUID, IScene>();
string[] sceneFiles = null;
try { sceneFiles = Directory.GetFiles(SOURCE_PATH, "*.ini", SearchOption.AllDirectories); }
catch (DirectoryNotFoundException)
{
m_log.Warn(Path.GetFullPath(SOURCE_PATH) + " not found, cannot load scene definitions");
return false;
}
for (int i = 0; i < sceneFiles.Length; i++)
{
// Create the config source for this region by merging the app config and the region config
IConfigSource configSource = simian.GetConfigCopy();
IniConfigSource regionConfigSource = new IniConfigSource(sceneFiles[i]);
configSource.Merge(regionConfigSource);
IConfig config = configSource.Configs["LindenRegion"];
if (config != null)
{
UUID id;
UUID.TryParse(config.GetString("ID"), out id);
string name = config.GetString("Name");
uint locationX = 0, locationY = 0;
string[] locationParts = config.GetString("Location").Trim().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
if (locationParts.Length != 2 || !UInt32.TryParse(locationParts[0], out locationX) || !UInt32.TryParse(locationParts[1], out locationY))
{
m_log.Warn("Missing or invalid Location for " + name + " region");
}
Vector3d regionPosition = new Vector3d(locationX * (uint)REGION_SIZE, locationY * (uint)REGION_SIZE, 0.0d);
Scene scene = new Scene(id, name, regionPosition, new Vector3d(256.0, 256.0, 4096.0), simian, configSource);
m_log.Info("Starting scene " + scene.Name + " (" + scene.ID + ")");
scene.Start();
m_scenes[scene.ID] = scene;
//CreateMapTile(scene);
}
else
{
m_log.Warn("No [LindenRegion] config section found in " + sceneFiles[i] + ", skipping");
}
}
// Create the array
m_scenesArray = new IScene[m_scenes.Count];
int j = 0;
foreach (IScene scene in m_scenes.Values)
m_scenesArray[j++] = scene;
// Fire the OnSceneStart callback for each scene we started
SceneStartCallback callback = OnSceneStart;
if (callback != null)
{
for (int i = 0; i < m_scenesArray.Length; i++)
{
callback(m_scenesArray[i]);
}
}
return true;
}
示例5: Update
/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Update(GameTime gameTime)
{
// Allows the game to exit
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();
// TODO: Add your update logic here
//Update the current scene. If it returns true, then change over to the next
//scene (unless there are no scenes left).
bool sceneChange = currentScene.Update(gameTime);
if (sceneChange)
{
if (sceneQueue.Count > 0)
{
currentScene = sceneQueue.Dequeue();
currentScene.Start();
}
}
base.Update(gameTime);
}