当前位置: 首页>>代码示例>>C#>>正文


C# Scene.ManipulateSceneAsync方法代码示例

本文整理汇总了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));
        }
开发者ID:RolandKoenig,项目名称:RKKinectLounge,代码行数:21,代码来源:KinectSceletonStreamPresenter.cs

示例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);
            });
        }
开发者ID:RolandKoenig,项目名称:RKVideoMemory,代码行数:22,代码来源:GameScreenManagerLogic.cs

示例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>();
        }
开发者ID:RolandKoenig,项目名称:RKVideoMemory,代码行数:44,代码来源:GameScreenManagerLogic.cs


注:本文中的Scene.ManipulateSceneAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。