Пример #1
0
        // Update is called once per frame
        public void Update()
        {
            var fireTiles = TilemapHelper.GetTileCoordinates(Tilemap).Where(t => Tilemap.GetTile(t) is FireTile).ToList();

            if (fireTiles.Contains(TilePosition))
            {
                audioController.PlayUnitDeathSound();
                Destroy(gameObject);

                // Choose next unit
                var nextUnit = levelController.playerUnits.Where(unit => unit != null && unit.ActionPoints > 0).ToList();
                if (nextUnit.Count > 0)
                {
                    levelController.currentlySelectedUnit = levelController.playerUnits.IndexOf(nextUnit.First());
                }
                else
                {
                    levelController.currentlySelectedUnit = -1;
                }
            }
        }