Exemplo n.º 1
0
        private void Start()
        {
            _info = GetComponent <TileMapInfo>();
            GridPosition p1  = _info.GetGridPosition(new Vector3(-208, -160));
            GridPosition p11 = new GridPosition(1, 1);

            Debug.Assert(_info.GetTileType(p1) == TileType.Rock);
            Debug.Assert(_info.GetTileType(_info.GetGridPosition(_info.GetPlayer1StartPosition())) == TileType.Empty);
            Debug.Assert(_info.GetTileType(_info.GetGridPosition(_info.GetPlayer2StartPosition())) == TileType.Empty);
            Debug.Log(_info.GetTileType(new GridPosition(0, 0)));
        }
Exemplo n.º 2
0
        private void CheckHole()
        {
            var tileType = tileMapInfo.GetTileType(botEntity.transform.position);

            if (tileType == TileType.Hole)
            {
                Hp = new BotHp(0);
            }
        }
Exemplo n.º 3
0
        bool RockCheck(float x, float y, TileMapInfo tileMapInfo)
        {
            var gridSizeHalf = Global.GridSize / 2;

            x = x > 0 ? x + gridSizeHalf : x < 0 ? x - gridSizeHalf : x;
            y = y > 0 ? y + gridSizeHalf : y < 0 ? y - gridSizeHalf : y;
            var tileType = tileMapInfo.GetTileType(transform.position + new Vector3(x, y, 0));

            return(tileType == TileType.Rock);
        }
Exemplo n.º 4
0
        bool TancCheck(float x, float y, TileMapInfo tileMapInfo)
        {
            var gridSizeHalf = Global.GridSize / 2 + 1;

            x = x > 0 ? x + gridSizeHalf : x < 0 ? x - gridSizeHalf : x;
            y = y > 0 ? y + gridSizeHalf : y < 0 ? y - gridSizeHalf : y;
            GridPosition movePos  = tileMapInfo.GetGridPosition(transform.position + new Vector3(x, y, 0));
            var          tileType = tileMapInfo.GetTileType(transform.position + new Vector3(x, y, 0));

            if (tileType == TileType.Tank)
            {
                GridPosition myPos = tileMapInfo.GetGridPosition(transform.position);
                if (!(movePos.X == myPos.X && movePos.Y == myPos.Y))
                {
                    PosFix(tileMapInfo);
                    return(true);
                }

                ;
            }

            return(false);
        }
Exemplo n.º 5
0
 // Update is called once per frame
 void Update()
 {
     Debug.Log(tileInfo.GetTileType(new Vector3(-7, -5, 0)));
 }
 public override void Run()
 {
     result = tileMapInfo.GetTileType(gridPosition);
     Finished();
 }