Exemplo n.º 1
0
        public override void Build(Vector3 finalPos, float buildTime, int fallheight, Ease easeType, BuildConfig.BuildableBlueprint blueprint)
        {
            _explosionMask = LayerMask.GetMask(maskList);
            base.Build(finalPos, buildTime, fallheight, easeType, blueprint);

            Tween t = transform.DOMove(finalPos, buildTime).SetEase(easeType).OnComplete(() =>
            {
                DamageUtil.ApplyExplosionDamage(this, finalPos, _blueprint.explodeRadius, _blueprint.damage, _explosionMask, ref _cachedColliders);

                Singleton.instance.particleGod.GenerateParticle(Particle.Type.HelixBomb, finalPos);
                Singleton.instance.audioSystem.PlaySound(SoundBank.Type.HelixBomb);
                RemoveFromPool();
            });
        }
Exemplo n.º 2
0
        private void applyDamage()
        {
            Vector3 position = transform.position;

            if (_blueprint != null)
            {
                DamageUtil.ApplyExplosionDamage(this, position, _blueprint.explodeRadius, _blueprint.damage, _explosionMask, ref _cachedCollider);
            }

            Singleton.instance.particleGod.GenerateParticle(Particle.Type.BaseExplosion, position);
            Singleton.instance.audioSystem.PlaySound(SoundBank.Type.Explosion, null, true);

            killTweens();
            RemoveFromPool();
        }