예제 #1
0
    //The auxiliary action of the fire powerup
    public override void DoAuxillaryAction(CombinablePowerup sourcePowerup, Vector3 position)
    {
        var particleInstance = GameObject.Instantiate(FireParticles, position, Quaternion.identity);

        particleInstance.SourcePowerup = this;

        var particleSystems = particleInstance.GetComponentsInChildren <ParticleSystem>();

        foreach (var particle in particleSystems)
        {
            var shape = particle.shape;
            shape.radius = particleSize;
        }

        particleInstance.StartCoroutine(AuxillaryRoutine());


        IEnumerator AuxillaryRoutine()
        {
            yield return(new WaitForSeconds(auxillaryLifeTime));

            foreach (var particle in particleSystems)
            {
                particle.Stop(false, ParticleSystemStopBehavior.StopEmitting);
            }

            particleInstance.GetComponent <Collider>().enabled = false;
            particleInstance.Stop();
        }
    }
예제 #2
0
 //The auxiliary action of the electric powerup
 public override void DoAuxillaryAction(CombinablePowerup sourcePowerup, Vector3 position)
 {
     IsAuxillary   = true;
     cloudInstance = CreateCloud();
     cloudInstance.DoSingleStrike(position);
 }
예제 #3
0
 //The auxiliary action of the water powerup
 public override void DoAuxillaryAction(CombinablePowerup sourcePowerup, Vector3 position)
 {
     SpawnPuddle(auxillaryPuddleSize, position);
 }