using System.Reflection; using log4net; using Managers; using UnityEngine; public class PlayingFieldDetection : MonoBehaviour { private static ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// /// Updates the match conditions, when a ship leaves the playing field. /// /// private void OnTriggerExit(Collider collider) { if (collider.tag == "Ship") { if (!collider.TryGetComponent(out Ship ship)) { Log.Error($"Collider: {collider} was tagged as Ship, but has no Ship component."); return; } MatchManager.G.UpdateMatchCondition(new MatchConditionUpdate { Condition = WinCondition.Lives, ship = ship, count = -1 }); } } }