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;
 }
示例#2
0
    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() + "\"");
        }
    }
示例#3
0
    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);
            }
        }
    }
示例#4
0
 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;
     }
 }
示例#5
0
 protected virtual void DeathAction()
 {
     ParticleEffectPool.GetPool(deathEffect).NewEffect(transform.position, transform.forward, true);
     gameObject.SetActive(false);
 }
示例#6
0
 void Start()
 {
     fireballPool = ParticleEffectPool.GetPool(ParticleEffectPool.EffectType.FIREBALL_MEDIUM);
 }