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


C# IGameObject.getGameObjectTag方法代码示例

本文整理汇总了C#中IGameObject.getGameObjectTag方法的典型用法代码示例。如果您正苦于以下问题:C# IGameObject.getGameObjectTag方法的具体用法?C# IGameObject.getGameObjectTag怎么用?C# IGameObject.getGameObjectTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IGameObject的用法示例。


在下文中一共展示了IGameObject.getGameObjectTag方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: deleteGameObject

        /// <summary>
        /// 
        /// </summary>
        /// <param name="gameObject"></param>
        /// <param name="targetGameObjectListMapByTag"></param>
        private void deleteGameObject(IGameObject gameObject, Dictionary<String, List<IGameObject>> targetGameObjectListMapByTag)
        {
            Debug.Assert(gameObject != null, "expected gameObject not null.");
            Debug.Assert(targetGameObjectListMapByTag != null, "expected targetGameObjectListMapByTypeEnum not null");

            String gameObjectTag = gameObject.getGameObjectTag();

            if (targetGameObjectListMapByTag.ContainsKey(gameObjectTag)
                    && targetGameObjectListMapByTag[gameObjectTag].Contains(gameObject))
            {
                targetGameObjectListMapByTag[gameObjectTag].Remove(gameObject);
            }
        }
开发者ID:ErPanfi,项目名称:ProjectHCI,代码行数:18,代码来源:SceneManager.cs

示例2: registerGameObject

        /// <summary>
        /// 
        /// </summary>
        /// <param name="gameObject"></param>
        /// <param name="targetGameObjectListMapByTag"></param>
        private void registerGameObject(IGameObject gameObject, Dictionary<String, List<IGameObject>> targetGameObjectListMapByTag)
        {
            Debug.Assert(gameObject != null, "expected gameObject not null.");
            Debug.Assert(targetGameObjectListMapByTag != null, "expected targetGameObjectListMapByTypeEnum not null");

            String gameObjectTag = gameObject.getGameObjectTag();

            if (!targetGameObjectListMapByTag.ContainsKey(gameObjectTag))
            {
                targetGameObjectListMapByTag.Add(gameObjectTag, new List<IGameObject>(20));
            }
            targetGameObjectListMapByTag[gameObjectTag].Add(gameObject);
        }
开发者ID:ErPanfi,项目名称:ProjectHCI,代码行数:18,代码来源:SceneManager.cs

示例3: promoteToCollidableGameObject

        /// <summary>
        /// 
        /// </summary>
        /// <param name="collidableGameObject"></param>
        public void promoteToCollidableGameObject(IGameObject collidableGameObject)
        {
            Debug.Assert(this.gameObjectListMapByTag.ContainsKey(collidableGameObject.getGameObjectTag()), "add the specified object before try to register it as collidable.");
            Debug.Assert(this.gameObjectListMapByTag[collidableGameObject.getGameObjectTag()].Contains(collidableGameObject), "add the specified object before try to register it as collidable.");

            this.registerGameObject(collidableGameObject, this.collidableGameObjectListMapByTag);
        }
开发者ID:ErPanfi,项目名称:ProjectHCI,代码行数:11,代码来源:SceneManager.cs

示例4: removeGameObject

        /// <summary>
        /// 
        /// </summary>
        /// <param name="gameObject"></param>
        public void removeGameObject(IGameObject gameObject)
        {
            SceneNode targetSceneNode = SceneNode.getSceneNodeByGameObject(this.sceneNodeTree, gameObject);

            //if targetSceneNode equals to null then it is the special case when its parent node and this gameObject node has
            //expired at the same frame, so sceneBrain calls removeGameObject on both, but it calls removeGameObject on parent node first,
            //forcing the sceneManager to delete all the childs node too. Consequentially, the later call to removeGameObject on the child node
            //traduces to a tree-search miss.
            if (targetSceneNode == null)
            {
                //assert that all data of this game object was already removed.
                Debug.Assert(!this.gameObjectListMapByTag.ContainsKey(gameObject.getGameObjectTag()) || !this.gameObjectListMapByTag[gameObject.getGameObjectTag()].Contains(gameObject));
                Debug.Assert(!this.collidableGameObjectListMapByTag.ContainsKey(gameObject.getGameObjectTag()) || !this.collidableGameObjectListMapByTag[gameObject.getGameObjectTag()].Contains(gameObject));
            }
            else
            {
                this.recursiveRemoveGameObject(targetSceneNode);
            }
        }
开发者ID:ErPanfi,项目名称:ProjectHCI,代码行数:23,代码来源:SceneManager.cs

示例5: gameObjectExist

 /// <summary>
 /// 
 /// </summary>
 /// <param name="gameObject"></param>
 /// <returns></returns>
 public bool gameObjectExist(IGameObject gameObject)
 {
     return gameObject == null
         || (    this.gameObjectListMapByTag.ContainsKey(gameObject.getGameObjectTag())
             &&  this.gameObjectListMapByTag[gameObject.getGameObjectTag()].Contains(gameObject));
 }
开发者ID:ErPanfi,项目名称:ProjectHCI,代码行数:11,代码来源:SceneManager.cs

示例6: onCollisionEnterDelegate

        /// <summary>
        /// 
        /// </summary>
        /// <param name="otherGameObject"></param>
        public override void onCollisionEnterDelegate(IGameObject otherGameObject)
        {
            switch (otherGameObject.getGameObjectTag())
            {
                case Tags.CUT_TAG:

                    this.isCut = true;
                    Random random = new Random();

                    //create floating death label
                    GameLoop.getSpawnerManager().specialRequestToSpawn(new GameObjectSpawnRequest(new GameFloatingLabelObject(this, GameFloatingLabelObject.points2string(FRUIT_DEATH_POINTS)), null));

                    Image stainImage = new Image();
                    stainImage.Source = new BitmapImage(new Uri(BitmapUtility.getImgResourcePath("stain" + random.Next(1, 21) + ".png")));
                    stainImage.Height = 260;
                    stainImage.Width = 390;

                    StainGameObject stainFadeOutGameObject = new StainGameObject(this._xPosition - stainImage.Width * 0.5, this._yPosition - stainImage.Height * 0.5, stainImage, 4500, 2000);
                    GameLoop.getSpawnerManager().specialRequestToSpawn(new GameObjectSpawnRequest(stainFadeOutGameObject, null));

                    break;

                case Tags.USER_TAG:
                    this.isCollected = true;
                    //create floating death label
                    GameLoop.getSpawnerManager().specialRequestToSpawn(new GameObjectSpawnRequest(new GameFloatingLabelObject(this, GameFloatingLabelObject.points2string(FRUIT_COLLECTION_POINTS)), null));

                    {// fruit collected sound
                        SoundGameObject soundGameObject = new SoundGameObject(new Uri(@"Resources\Sounds\fruit_collected.wav", UriKind.Relative), false);
                        GameLoop.getSpawnerManager().specialRequestToSpawn(new GameObjectSpawnRequest(soundGameObject, null));
                    }

                    break;
            }
        }
开发者ID:ErPanfi,项目名称:ProjectHCI,代码行数:39,代码来源:FruitGameObject.cs

示例7: onCollisionEnterDelegate

        /// <summary>
        /// 
        /// </summary>
        /// <param name="otherGameObject"></param>
        public override void onCollisionEnterDelegate(IGameObject otherGameObject)
        {
            if (otherGameObject.getGameObjectTag() == Tags.FRUIT_TAG)
            {
                this.cutSuccess = true;

                //cut success sound
                SoundGameObject soundGameObject = new SoundGameObject(new Uri(@"Resources\Sounds\fruit_cutted.wav", UriKind.Relative), false);
                GameLoop.getSpawnerManager().specialRequestToSpawn(new GameObjectSpawnRequest(soundGameObject, null));
            }
        }
开发者ID:ErPanfi,项目名称:ProjectHCI,代码行数:15,代码来源:CutGameObject.cs

示例8: onCollisionEnterDelegate

 /// <summary>
 /// 
 /// </summary>
 /// <param name="otherGameObject"></param>
 public override void onCollisionEnterDelegate(IGameObject otherGameObject)
 {
     if (otherGameObject.getGameObjectTag() == Tags.USER_TAG)
     {
         GameLoop.getSceneManager().applyScale(this, 1.2, 1.2, this.getImage().Width * 0.5, this.getImage().Height * 0.5, true);
         this.pointedByObject = true;
         this.runningHourglass = new HourglassGUIGameObject(otherGameObject, new string[] { @"Hourglass_1.png", @"Hourglass_2.png", @"Hourglass_3.png", @"Hourglass_4.png" });
         GameLoop.getSceneManager().addGameObject(runningHourglass, otherGameObject);
     }
 }
开发者ID:ErPanfi,项目名称:ProjectHCI,代码行数:14,代码来源:ButtonGameObject.cs

示例9: onCollisionExitDelegate

 /// <summary>
 /// 
 /// </summary>
 /// <param name="otherGameObject"></param>
 public override void onCollisionExitDelegate(IGameObject otherGameObject)
 {
     if (otherGameObject.getGameObjectTag() == Tags.USER_TAG)
     {
         ISceneManager sceneManager = GameLoop.getSceneManager();
         sceneManager.applyScale(this, 1 / 1.2, 1 / 1.2, this.getImage().Width * 0.5, this.getImage().Height * 0.5, true);
         this.pointedByObject = false;
         this.internalCountDown = USER_INTERACTION_DELAY;
         if (this.runningHourglass != null)
         {
             sceneManager.removeGameObject(runningHourglass);
         }
     }
 }
开发者ID:ErPanfi,项目名称:ProjectHCI,代码行数:18,代码来源:ButtonGameObject.cs


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