예제 #1
0
        public void RecalculateFlagStampsForShieldBorder(Entity shieldGeneratorEntity, bool shieldUp)
        {
            BoardItem       boardItem       = shieldGeneratorEntity.Get <BoardItemComponent>().BoardItem;
            WorldController worldController = Service.WorldController;

            boardItem.CurrentBoard.RemoveFlagStamp(boardItem.FlagStamp);
            int       num = worldController.CalculateWalkableGap(boardItem.Size);
            FlagStamp flagStamp;

            if (shieldUp)
            {
                ShieldGeneratorComponent sgc = shieldGeneratorEntity.Get <ShieldGeneratorComponent>();
                flagStamp = this.CreateFlagStampForShield(sgc, boardItem.Size, num);
            }
            else
            {
                flagStamp = worldController.CreateFlagStamp(null, null, boardItem.Size, num);
            }
            boardItem.FlagStamp = flagStamp;
            worldController.AddUnWalkableUnDestructibleFlags(boardItem.FlagStamp, boardItem.Size, num, false);
            boardItem.FlagStamp.CenterTo(boardItem.BoardX + (boardItem.Width - num) / 2, boardItem.BoardZ + (boardItem.Depth - num) / 2);
            boardItem.CurrentBoard.AddFlagStamp(boardItem.FlagStamp);
        }