public override void Initialize(Player[] players, GameplayMode mode, PlayArea playArea) { base.Initialize(players, mode, playArea); bulletDirectionScale = GetDirectionScaleVector(); SetAppropriateBulletPool(); chargeEffectPool = ParticleEffectPool.GetPool(ParticleEffectPool.EffectType.CHARGE_ENEMY); initialized = true; }
ParticleEffectPool GetProperEffectPool() { switch (type) { case BulletPoolType.ENEMY_SLOW: return(ParticleEffectPool.GetPool(ParticleEffectPool.EffectType.BULLETHIT_ENEMY)); case BulletPoolType.ENEMY_NORMAL: return(ParticleEffectPool.GetPool(ParticleEffectPool.EffectType.BULLETHIT_ENEMY)); case BulletPoolType.ENEMY_FAST: return(ParticleEffectPool.GetPool(ParticleEffectPool.EffectType.BULLETHIT_ENEMY)); case BulletPoolType.FRIENDLY_NORMAL: return(ParticleEffectPool.GetPool(ParticleEffectPool.EffectType.BULLETHIT_FRIENDLY)); case BulletPoolType.FRIENDLY_FAST: return(ParticleEffectPool.GetPool(ParticleEffectPool.EffectType.BULLETHIT_FRIENDLY)); default: throw new UnityException("unsupported bullettype \"" + type.ToString() + "\""); } }
void FixedUpdate() { if ((Time.time > explodeTime) && mr.enabled) { mr.enabled = false; coll.enabled = true; // ParticleEffectPool.GetPool(ParticleEffectPool.EffectType.EXPLOSION_AA).NewEffect(transform.position, transform.forward, true, gameObject.layer); ParticleEffectPool.GetPool(ParticleEffectPool.EffectType.EXPLOSION_AA).NewEffect(transform.position, transform.forward, true); } if (coll.enabled) { fixedUpdateTicks++; if (fixedUpdateTicks > fixedUpdateHurtTicks) { gameObject.SetActive(false); } } }
void Update() { if (hitpoints <= 0 && coll.enabled) { for (int i = 0; i < explosionPoints.Length; i++) { ParticleEffectPool pool; if (Random.value > 0.5f) { pool = ParticleEffectPool.GetPool(ParticleEffectPool.EffectType.FIREBALL_MEDIUM); Debug.Log("medium"); } else { pool = ParticleEffectPool.GetPool(ParticleEffectPool.EffectType.FIREBALL_SMALL); Debug.Log("small"); } pool.NewEffect(explosionPoints[i].transform.position, Random.insideUnitSphere, gameObject.transform.parent, gameObject.layer); //LayerMask.NameToLayer("Background") } theObject.SetActive(false); coll.enabled = false; } }
protected virtual void DeathAction() { ParticleEffectPool.GetPool(deathEffect).NewEffect(transform.position, transform.forward, true); gameObject.SetActive(false); }
void Start() { fireballPool = ParticleEffectPool.GetPool(ParticleEffectPool.EffectType.FIREBALL_MEDIUM); }