本文整理汇总了C#中Scene.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Scene.GetType方法的具体用法?C# Scene.GetType怎么用?C# Scene.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scene
的用法示例。
在下文中一共展示了Scene.GetType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSceneAfter
public Scene GetSceneAfter(Scene scene)
{
ensureScenesInstantiated();
if (scene == null) return GetFirstScene();
int sceneIndex = Array.FindIndex<Scene>(scenes, s => s.GetType() == scene.GetType());
if (sceneIndex > scenes.Length)
throw new InvalidOperationException();
return scenes[sceneIndex + 1];
}
示例2: isLastScene
public bool isLastScene(Scene scene)
{
if (scene.GetType() == LAST_SCENE) return true;
return false;
}
示例3: isFirstScene
public bool isFirstScene(Scene scene)
{
if (scene.GetType() == typeof(TitleScene)) return true;
return false;
}
示例4: CreateScene
private Scene CreateScene(XmlNode sceneresource)
{
Scene toRet = null;
XmlNode nodeID = sceneresource.Attributes.GetNamedItem("id");
Debug.Assert(nodeID != null, "[WARNING] - A scene resource node must have a unique id!");
if (nodeID != null)
{
// See if a filename was attached
XmlNode sceneFile = sceneresource.Attributes.GetNamedItem("file");
Debug.Assert(sceneFile != null, "[WARNING] - A scene resource node must have a file attached!");
String nodeIDName = nodeID.InnerText;
String nodeFile = sceneFile.InnerText;
// Create the scene accordingly whether it is 3D or not
toRet = new Scene(nodeIDName, nodeFile);
// Add any scene properties
foreach (XmlNode child in sceneresource)
{
if (child.Attributes.Count > 0)
{
XmlAttribute attr = child.Attributes[0];
String propertyName = attr.Name;
String value = attr.InnerText;
// Set the property through the factory assigned properties
bool success = Factory.Instance.SetProperty(toRet.GetType(), propertyName, value, toRet);
Debug.Assert(success, "[Warning] - Loading property " + propertyName + " on node " + toRet.Name + " failed!");
}
}
}
return toRet;
}