Beispiel #1
0
    public void ClearDetected()
    {
        DetectableOceanEntity test = detectedEntities[0];

        detectedEntities.Clear();
        detectedEntities.Add(test);
    }
Beispiel #2
0
 protected void RemoveDetectable(DetectableOceanEntity entity)
 {
     if (detectedEntities.Contains(entity))
     {
         detectedEntities.Remove(entity);
     }
     if (entity.detectors.Contains(this))
     {
         entity.detectors.Remove(this);
     }
 }
Beispiel #3
0
    //Get the point out of the unused state in the pool and place it on the map
    public void ActivatePoint(DetectableOceanEntity target, float _fadeDuration, CaptasFour _source)
    {
        levelManager = GameManager.Instance.levelManager;

        transform.position = Coordinates.ConvertVector2ToWorld(target.coords.position);
        coords.position    = Coordinates.ConvertWorldToVector2(transform.position);

        fadeDuration = _fadeDuration;
        source       = _source;

        AddDetectable(target);

        gameObject.SetActive(true);

        StartCoroutine(Fade());
    }
Beispiel #4
0
    //Get the point from his state of unused in the pool and activate in GameWorld
    public IEnumerator ActivatePoint(DetectableOceanEntity detectedElement, float _fadeDuration, HullSonar _source)
    {
        levelManager = GameManager.Instance.levelManager;

        source = _source;
        levelManager.activatedDetectionObjects.Add(this);

        transform.position = Coordinates.ConvertVector2ToWorld(detectedElement.coords.position);
        coords.position    = Coordinates.ConvertWorldToVector2(transform.position);
        fadeDuration       = _fadeDuration;

        gameObject.SetActive(true);

        yield return(null);

        AddDetectable(detectedElement);

        fadeCouroutine = StartCoroutine(Fade());
    }
Beispiel #5
0
 protected void AddDetectable(DetectableOceanEntity entity)
 {
     detectedEntities.Add(entity);
     entity.detectors.Add(this);
 }
Beispiel #6
0
 public void DesactivatePoint(HullSonarDetectionPoint point, DetectableOceanEntity entity)
 {
     levelManager.activatedDetectionObjects.Remove(point);
     availableDetectionPoints.Add(point);
     usedDetectionPoints.Remove(entity);
 }
Beispiel #7
0
 public void ActivateNewPoint(DetectableOceanEntity entity)
 {
     GameManager.Instance.ExternalStartCoroutine(availableDetectionPoints[0].ActivatePoint(entity, pointFadeDuration, this));
     usedDetectionPoints.Add(entity, availableDetectionPoints[0]);
     availableDetectionPoints.RemoveAt(0);
 }