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


C# Door.Unload方法代码示例

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


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

示例1: GeneratePrison

        public void GeneratePrison(Vector2 position, GameData data)
        {
            const float doorSize = 96;
            const float doorAscent = 64;
            const float prisonWidth = 576;
            const float prisonHeight = 576;
            const float halfWidth = prisonWidth / 2;
            const float halfHeight = prisonHeight / 2;
            const float wallWidth = 16;
            const float wallHalfWidth = wallWidth / 2;

            const float doorTopHeight = doorSize + doorAscent;
            const float wallAboveDoorSize = (prisonHeight - (doorAscent + doorSize));
            const float halfWallAboveDoorSize = wallAboveDoorSize / 2;

            const float cellSize = prisonWidth / 3;
            const float cellDoorSize = 96;
            float internalWallHeight = position.Y + halfHeight - cellSize - wallHalfWidth;
            float internalWallSize = cellSize - cellDoorSize;

            //floor
            EntList.Add(new BldgFloor(position, new Vector2(prisonWidth, prisonHeight)));

            //solid walls
            EntList.Add(new BldgWall(position + new Vector2(0, halfHeight + wallHalfWidth), new Vector2(prisonWidth + 2 * wallWidth, wallWidth), 0));
            EntList.Add(new BldgWall(position - new Vector2(0, halfHeight + wallHalfWidth), new Vector2(prisonWidth + 2 * wallWidth, wallWidth), 0));
            EntList.Add(new BldgWall(position + new Vector2(halfWidth + wallHalfWidth, 0), new Vector2(prisonHeight, wallWidth), 3 * MathHelper.PiOver2));

            //wall w/ entrance
            EntList.Add(new BldgWall(position - new Vector2(halfWidth + wallHalfWidth, halfHeight - (doorAscent / 2)), new Vector2(doorAscent, wallWidth), MathHelper.PiOver2));
            EntList.Add(new BldgWall(position - new Vector2(halfWidth + wallHalfWidth, halfHeight - doorTopHeight - halfWallAboveDoorSize), new Vector2(wallAboveDoorSize, wallWidth), MathHelper.PiOver2));

            //internal walls
            EntList.Add(new BldgWall(new Vector2(position.X - halfWidth + cellDoorSize + (internalWallSize / 2), internalWallHeight), new Vector2(cellSize - cellDoorSize, wallWidth), 0));
            EntList.Add(new BldgWall(new Vector2(position.X - halfWidth + cellSize + cellDoorSize + (internalWallSize / 2), internalWallHeight), new Vector2(cellSize - cellDoorSize, wallWidth), 0));
            EntList.Add(new BldgWall(new Vector2(position.X - halfWidth + 2 * cellSize + cellDoorSize + (internalWallSize / 2), internalWallHeight), new Vector2(cellSize - cellDoorSize, wallWidth), 0));
            EntList.Add(new BldgWall(new Vector2(position.X - halfWidth + cellSize - wallHalfWidth, internalWallHeight + (cellSize / 2) + wallHalfWidth), new Vector2(cellSize, wallWidth), 3 * MathHelper.PiOver2));
            EntList.Add(new BldgWall(new Vector2(position.X - halfWidth + 2 * cellSize - wallHalfWidth, internalWallHeight + (cellSize / 2) + wallHalfWidth), new Vector2(cellSize, wallWidth), 3 * MathHelper.PiOver2));

            //key
            if (!data.PrisonKeyFound)
            {
                DoorKey prisonKey = new DoorKey(position + new Vector2(halfWidth, -halfHeight) - new Vector2(32, -32), "prison door key");
                PickupTriggers.Add(new TriggerPickup(prisonKey.Position, new Vector2(64, 64), prisonKey));
                EntList.Add(prisonKey);
            }

            Note n = new Note(position - new Vector2(halfWidth, halfHeight) + new Vector2(64, 64));
            EntList.Add(n);
            ReadingTriggers.Add(new TriggerReading(n.Position, new Vector2(64, 64), Notes.PrisonNote));

            //doors
            Door prisonDoor = new Door(new Vector2(position.X - halfWidth + (cellDoorSize / 2), internalWallHeight), 0, "prison door");
            if (!data.PrisonDoorOpened)
            {
                EntList.Add(prisonDoor);
            }
            else
                prisonDoor.Unload();
            EntList.Add(new Door(new Vector2(position.X - halfWidth + cellSize + (cellDoorSize / 2), internalWallHeight), 0));
            EntList.Add(new Door(new Vector2(position.X - halfWidth + cellSize * 2 + (cellDoorSize / 2), internalWallHeight), 0));

            DoorOpenTriggers.Add(new TriggerDoorOpen(prisonDoor.Position, new Vector2(96, 96), prisonDoor, "prison door key"));

            //fuse
            if (!data.FuseFound)
            {
                Fuse f = new Fuse(new Vector2(position.X - halfWidth + (cellSize / 2), internalWallHeight + (cellSize / 2)));
                EntList.Add(f);
                PickupTriggers.Add(new TriggerPickup(f.Position, new Vector2(64, 64), f));
            }
        }
开发者ID:Robmaister,项目名称:RoversSpirit,代码行数:72,代码来源:AreaMars.cs


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