コード例 #1
0
 public BridgeDivider(GameObject bridge)
 {
     _bridge              = bridge.transform;
     _hasDestroyed        = false;
     _joints              = new List <DistanceJoint2D>();
     _contacts            = bridge.GetOrAddComponent <TriggerContacts>();
     _contacts.IsContact += CountContacts;
 }
コード例 #2
0
        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;
        }
コード例 #3
0
 public CoinsListener(GameObject coin)
 {
     _coin = coin;
     _coinTrigger = coin.gameObject.GetOrAddComponent<TriggerContacts>();
     _coinTrigger.IsContact += OnContact;
 }