public void ClearDetected() { DetectableOceanEntity test = detectedEntities[0]; detectedEntities.Clear(); detectedEntities.Add(test); }
protected void RemoveDetectable(DetectableOceanEntity entity) { if (detectedEntities.Contains(entity)) { detectedEntities.Remove(entity); } if (entity.detectors.Contains(this)) { entity.detectors.Remove(this); } }
//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()); }
//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()); }
protected void AddDetectable(DetectableOceanEntity entity) { detectedEntities.Add(entity); entity.detectors.Add(this); }
public void DesactivatePoint(HullSonarDetectionPoint point, DetectableOceanEntity entity) { levelManager.activatedDetectionObjects.Remove(point); availableDetectionPoints.Add(point); usedDetectionPoints.Remove(entity); }
public void ActivateNewPoint(DetectableOceanEntity entity) { GameManager.Instance.ExternalStartCoroutine(availableDetectionPoints[0].ActivatePoint(entity, pointFadeDuration, this)); usedDetectionPoints.Add(entity, availableDetectionPoints[0]); availableDetectionPoints.RemoveAt(0); }