本文整理汇总了C#中Scene.ManipulateSceneAsync方法的典型用法代码示例。如果您正苦于以下问题:C# Scene.ManipulateSceneAsync方法的具体用法?C# Scene.ManipulateSceneAsync怎么用?C# Scene.ManipulateSceneAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scene
的用法示例。
在下文中一共展示了Scene.ManipulateSceneAsync方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: KinectSceletonStreamPresenter
/// <summary>
/// Initializes a new instance of the <see cref="KinectSceletonStreamPresenter"/> class.
/// </summary>
public KinectSceletonStreamPresenter()
{
m_bodyData = new List<Body>();
m_bodyDataModified = false;
// Prepare scene object
m_bodyScene = new Scene();
m_bodyScene.ManipulateSceneAsync(OnBodyScene_Initialize);
// Get the Messenger of the KinectThread
SeeingSharpMessenger kinectMessenger =
SeeingSharpMessenger.GetByName(Constants.KINECT_THREAD_NAME);
// Subscribe to messages from kinect
m_messageSubscriptions = new List<MessageSubscription>();
m_messageSubscriptions.Add(
kinectMessenger.Subscribe<MessageBodyFrameArrived>(OnMessage_BodyFrameArrived));
}
示例2: ClearAsync
/// <summary>
/// Clears the current map from the given scene.
/// </summary>
/// <param name="scene">The scene to be cleard..</param>
internal async Task ClearAsync(Scene scene)
{
m_cardPairsOnScreen.EnsureNotNull("m_cardPairs");
await scene.ManipulateSceneAsync((manipulator) =>
{
foreach (CardPairLogic actPair in m_cardPairsOnScreen)
{
foreach (Card actCard in actPair.Cards)
{
manipulator.Remove(actCard);
}
manipulator.Remove(actPair);
}
manipulator.Clear(true);
});
}
示例3: BuildFirstScreenAsync
/// <summary>
/// Builds all game objects for the given level.
/// </summary>
/// <param name="currentLevel">The current level.</param>
/// <param name="scene">The scene to which to add all objects.</param>
internal async Task BuildFirstScreenAsync(LevelData currentLevel, Scene scene)
{
m_scene = scene;
m_currentLevel = currentLevel;
int tilesX = currentLevel.Tilemap.TilesX;
int tilesY = currentLevel.Tilemap.TilesY;
float tileDistX = Constants.TILE_DISTANCE_X;
float tileDistY = -Constants.TILE_DISTANCE_Y;
Vector3 midPoint = new Vector3((tilesX - 1) * tileDistX / 2f, 0f, ((tilesY - 1) * tileDistY / 2f));
m_cardMapOnScreen = new Card[tilesX, tilesY];
m_cardPairsOnScreen = new List<CardPairLogic>();
ScreenData currentScreen = currentLevel.Screens[0];
m_actScreenIndex = 0;
await scene.ManipulateSceneAsync((manipulator) =>
{
// Build background and define level-wide resources
manipulator.BuildBackground(currentLevel.MainTextures.BackgroundTextureLink);
m_resBackgroundMaterial1 = manipulator.AddSimpleColoredMaterial(
currentLevel.MainTextures.Tile1TextureLink);
m_resBackgroundMaterial2 = manipulator.AddSimpleColoredMaterial(
currentLevel.MainTextures.Tile2TextureLink);
// Build the current screen
BuildScreen(manipulator, currentScreen);
// Add all logic components to the scene
manipulator.Add(new PairUncoverLogic());
manipulator.Add(new VideoPlayLogic());
manipulator.Add(new BackgroundMusicLogic(currentLevel));
manipulator.Add(new EndGameLogic(currentLevel));
manipulator.Add(this);
});
Messenger.BeginPublish<MainMemoryScreenEnteredMessage>();
}