public BridgeDivider(GameObject bridge) { _bridge = bridge.transform; _hasDestroyed = false; _joints = new List <DistanceJoint2D>(); _contacts = bridge.GetOrAddComponent <TriggerContacts>(); _contacts.IsContact += CountContacts; }
public LevelCompleteManager(Transform character, List <TriggerContacts> deathZones, TriggerContacts winZone, IWinState state) { _startPosition = character.position; _character = character.gameObject.GetOrAddComponent <TriggerContacts>(); _state = state; _deathZones = deathZones; _winZone = winZone; foreach (var zone in _deathZones) { zone.IsContact += OnDeathZoneObjectContact; } _winZone.IsContact += OnWinZoneContact; }
public CoinsListener(GameObject coin) { _coin = coin; _coinTrigger = coin.gameObject.GetOrAddComponent<TriggerContacts>(); _coinTrigger.IsContact += OnContact; }