//! ----functions---- void Awake() { CollisionBus.Subscribe(new CollisionBus.Combo(TagName.Ball, TagName.Wall), (ball, wall, collision) => { TF.ObjectPool.Alloc(_vfx, 1f, collision.contacts[0].point); GlobalAudioSource.PlayOneShot(_se); }); }
//! ----functions---- void Awake() { CollisionBus.Subscribe(new CollisionBus.Combo(TagName.PlayerMissile, TagName.Wall), (missile, wall, collision) => { var missileCore = missile.GetComponent <Missiles.MissileCore>(); TF.ObjectPool.Alloc(_vfx, 1f, collision.contacts[0].point); GlobalAudioSource.PlayOneShot(_se); missileCore.Kill(); }); }
void Awake() { CollisionBus.Subscribe( new CollisionBus.Combo(TagName.PlayerBullet, TagName.Ball), (playerBullet, ball, collision) => { var efc = TF.ObjectPool.Alloc(_effect, 1f); efc.transform.position = collision.contacts[0].point; playerBullet.GetComponent <PlayerBullets.PlayerBulletCore>().Kill(); }); }
//! ----functions---- void Awake() { CollisionBus.Subscribe(TagName.Ball, TagName.LaserFence, (ball, laserFence, collision) => { var ballCore = ball.GetComponent <Balls.BallCore>(); TF.ObjectPool.Alloc(_vfx, 1f, ball.transform.position); GlobalAudioSource.PlayOneShot(_se); ballCore.Kill(); }); }
//! ----functions---- void Awake() { CollisionBus.Subscribe(new CollisionBus.Combo(TagName.PlayerMissile, TagName.Enemy), (missile, enemy, collision) => { TF.ObjectPool.Alloc(_vfx, 1f, missile.transform.position); GlobalAudioSource.PlayOneShot(_se); var missileCore = missile.GetComponent <Missiles.MissileCore>(); var enemyCore = enemy.GetComponent <Enemies.EnemyCore>(); enemyCore.ApplyDamage(missileCore.damage); missileCore.Kill(); }); }
//! ----functions---- void Awake() { CollisionBus.Subscribe(TagName.Ball, TagName.Enemy, (ball, enemy, collision) => { var ballCore = ball.GetComponent <Balls.BallCore>(); var enemyCore = enemy.GetComponent <Enemies.EnemyCore>(); TF.ObjectPool.Alloc(_hitVFX, 1f, collision.contacts[0].point); GlobalAudioSource.PlayOneShot(_hitSE); enemyCore.ApplyDamage(ballCore.damage); }); }
public void Unsubscribe() { CollisionBus.Unsubscribe(_combo, _handler); }