/// <summary>
        /// Called when the collidable is bumped into by someone/something
        /// </summary>
        public void Bump(IEntity ent)
        {
            OnBump?.Invoke(this, new EventArgs());

            Owner.SendMessage(this, ComponentMessageType.Bumped, ent);
            Owner.SendComponentNetworkMessage(this, NetDeliveryMethod.ReliableUnordered, ComponentMessageType.Bumped,
                                              ent.Uid);
        }
Ejemplo n.º 2
0
 public void OnTriggerEnter2D(Collider2D collider)
 {
     if (collider.gameObject.CompareTag("Ball") && bumperType == BumperType.BOARD)
     {
         OnBump?.Invoke(BumpValue);
         audioSource.Play();
     }
 }
Ejemplo n.º 3
0
 public void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.CompareTag("Ball") && bumperType == BumperType.DEFAULT)
     {
         OnBump?.Invoke(BumpValue);
         audioSource.Play();
     }
 }
        /// <summary>
        ///     Called when the collidable is bumped into by someone/something
        /// </summary>
        void ICollidable.Bump(IEntity ent)
        {
            OnBump?.Invoke(this, new EventArgs());

            Owner.SendMessage(this, ComponentMessageType.Bumped, ent);
        }
        /// <inheritdoc />
        void ICollidable.Bumped(IEntity bumpedby)
        {
            SendMessage(new BumpedEntMsg(bumpedby));

            OnBump?.Invoke(this, new BumpEventArgs(this.Owner, bumpedby));
        }
Ejemplo n.º 6
0
 public override void Update(GameTime gameTime)
 {
     Sprite.Update(gameTime, Location);
     OnBump?.Invoke(gameTime);
 }
 /// <inheritdoc />
 void ICollidable.Bump(IEntity ent)
 {
     OnBump?.Invoke(this, new BumpEventArgs(this.Owner, ent));
 }
Ejemplo n.º 8
0
 public void Activate()
 {
     OnBump?.Invoke();
 }
        /// <summary>
        ///     Called when the collidable is bumped into by someone/something
        /// </summary>
        void ICollidable.Bump(IEntity ent)
        {
            SendMessage(new BumpedEntMsg(ent));

            OnBump?.Invoke(this, new BumpEventArgs(this.Owner, ent));
        }