示例#1
0
    public void MagicTageting(Direction direction)
    {
        Coordinates coordinates;

        if (currentMagic.type == Magic.Type.shoot || !currentMagic.targeting)
        {
            if (tileMapManager.TileCheck(coordinates = player.PlayerDirection(direction)))
            {
                magicMarkerCoordinates = coordinates;
                magicMarker.position   = tileMapManager.CoordinatesToPostion(magicMarkerCoordinates) + Vector3.up * 0.2f;
                magicDirection         = direction;
            }
        }
        else
        {
            if (tileMapManager.TileCheck(coordinates = player.CoordinatesDirection(magicMarkerCoordinates, direction)) && tileMapManager.RangeCheck(tileMapManager.playerCoordinates, coordinates, currentMagic.range))
            {
                magicMarkerCoordinates = coordinates;
                magicMarker.position   = tileMapManager.CoordinatesToPostion(magicMarkerCoordinates) + Vector3.up * 0.2f;
            }
        }
    }
示例#2
0
 // 에너미를 생성하고, TileMapManager.Instance.currentEnemys 리스트에 좌표와 트랜스폼 값을 추가 합니다.
 public void EnemySpawn()
 {
     for (int i = 0; i < enemys.Length; i++)
     {
         for (int count = 0; count < enemys[i].enemyCount; count++)
         {
             Coordinates spawnCoordinates = tileMapManager.GetRandomNomalCoordinates();
             Vector3     spawnPosition    = tileMapManager.CoordinatesToPostion(spawnCoordinates);
             Enemy       enemy            = Instantiate(enemys[i].prefeb, spawnPosition, Quaternion.identity);
             enemy.GeneratorSetUp(enemys[i], spawnCoordinates);
             tileMapManager.currentEnemys.Add(spawnCoordinates, enemy);
             tileMapManager.currentObject.Add(spawnCoordinates, TileMapManager.ObjectType.enemy);
         }
     }
 }