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