private void AddEnemyToRadar(TrackedEnemy enemy)
    {
        // Get an inactive dot
        var dot = _dots.Find(item => !item.gameObject.activeSelf);

        var enemyPositionRelatedToPlayer = _player.transform.InverseTransformPoint(enemy.transform.position);

        var scaleFactor = _centerRadius / _enemyContainer.ColliderRadius;
        var dotPosition = enemyPositionRelatedToPlayer * scaleFactor;

        PlaceDotOnUi(dot, dotPosition);

        //Activate the dot
        dot.gameObject.SetActive(true);
    }
示例#2
0
 public void RemoveEnemy(TrackedEnemy enemy)
 {
     _enemyList.Remove(enemy);
 }
示例#3
0
 public void RemoveEnemy(TrackedEnemy enemy)
 {
     _enemyContainer.RemoveEnemy(enemy);
 }