private void OnDestroyObjectEntityEvent(DestroyObjectEntityEventPayload payload)
 {
     if (payload.Sender.TryGetComponent(out Entity entity) && entity.Owner == m_playerEntity.transform)
     {
         m_eventBus.Dispatch(PlayerAddBulletEventPayload.Create(5));
     }
 }
コード例 #2
0
 private void OnBulletCollisionEvent(BulletCollisionEventPayload payload)
 {
     if (payload.CollisionTransform != transform)
     {
         return;
     }
     EventBus.Dispatch(DestroyObjectEntityEventPayload.Create(this, payload.BulletEntity.transform));
     GameManager.Instance.GameFactory.ObjectFactory.DestroyEntity(this);
 }