Пример #1
0
 public void play_button()
 {
     foreach (ParticleSystem PS in ParticleSystems)
     {
         PS.Play();
     }
 }
Пример #2
0
 public void Play()
 {
     foreach (ParticleSystem PS in ParticleSystems)
     {
         PS.Play();
     }
 }
Пример #3
0
 public void playHighThrust()
 {
     foreach (ParticleSystem PS in highThrust)
     {
         PS.Play();
     }
 }
Пример #4
0
 public void playLowThrust()
 {
     foreach (ParticleSystem PS in lowThrust)
     {
         PS.Play();
     }
 }
Пример #5
0
 public void playMidThrust()
 {
     foreach (ParticleSystem PS in midThrust)
     {
         PS.Play();
     }
 }
Пример #6
0
 /// <summary>
 /// Will play the list of particles attached to this object
 /// </summary>
 private void PlayExplosion()
 {
     foreach (var PS in m_Explosion)
     {
         PS.Play();
     }
     FindObjectOfType <FailStateManager>().SwitchGameState(GameState.FAILED);
 }
Пример #7
0
 private void processIsFireball()
 {
     if (isFireball)
     {
         gameObject.tag = tags.FIREBALL;
     }
     foreach (ParticleSystem PS in GetComponentsInChildren <ParticleSystem>())
     {
         PS.Play();
     }
 }
Пример #8
0
 private void PlayChargingFxs()
 {
     foreach (ParticleSystem PS in chargingPartSystList)
     {
         PS.Play();
     }
     foreach (ParticleSystem PS in chargingMainSystList)
     {
         PS.Play();
     }
 }
Пример #9
0
    // Update is called once per frame
    void Update()
    {
        // removable - only for debug purposes
        if (m_debugMode)
        {
            DebugDraw();
        }
        // removable - only for debug purposes
        if (m_forceExplode)
        {
            m_pressure          += m_explosivePressure;
            m_liquidTemperature += m_boilingPoint;
        }
        // check if the temp is below its idle temp and reset it.
        if (m_liquidTemperature <= m_idleTemp)
        {
            m_liquidTemperature = m_idleTemp;
        }



        // Check whether the liquid temp is greater than the boiling point.
        // once this happens we are starting to produce gases. // NOTE: usual cases there would already be gases being produced but for simplicity we are just creating gases when the boiling point is reached
        // when the pressure is higher than the valve release point the valve will open and release some of the gasses.
        // this will happen depending on the int set in the inspector "m_valveReleaseAmount"
        // everytime the gas is released a var "m_lossPerRelease" will be deducted from the total pressure that was accumulated
        // once the gas has been released we will play the particle system.
        // if the pressure is greater than the explosive pressure we will set the particles to play
        // after the object has exploded ??? possibly replace mesh with a destroyed one.
        if (m_liquidTemperature > m_boilingPoint)
        {
            float gasRelease = (m_pressureGainAmount * Time.deltaTime) * (m_liquidTemperature / m_boilingPoint);
            m_pressure   += gasRelease;
            m_liquidMass -= gasRelease;
            // start producing gasses
            if (m_pressure > m_pressureRelease && m_valveReleaseAmount > 0)
            {
                foreach (var PS in m_valveParticles)
                {
                    PS.Play();
                    valveReleaseAudio.PlayOneShot(releaseAudio, 0.7f);
                }
                m_valveReleaseAmount--;
                m_pressureRelease += m_pressureReleaseOriginal;
                m_pressure        -= m_lossPerRelease;
            }
            if (m_pressure >= m_explosivePressure && !m_hasExploded)
            {
                valveReleaseAudio.PlayOneShot(explosion, 0.7f);
                Invoke("PlayExplosion", 0.1f);
                m_hasExploded = true;
            }
        }
    }
Пример #10
0
 /// <summary>
 /// Set the Particle Systems Time according to PSTime variable, if put to 0 it will stop immediately
 /// </summary>
 public void UpdatePSTime()
 {
     //set the simulation time in every particle, minding the the simulation speed
     foreach (ParticleSystem PS in GetComponentsInChildren <ParticleSystem>())
     {
         var m = PS.main;
         m.loop = false;
         //To change the duration the particle needs to pe paused
         PS.Pause();
         m.duration = PSTime * m.simulationSpeed;
         //check if the particle is finished
         PS.Play();
         DisableTrail = (PS.time >= m.duration);
     }
 }
Пример #11
0
    IEnumerator coroutine(float endTime)
    {
        foreach (ParticleSystem PS in ParticleSystems)
        {
            PS.Play();
        }

        if (hasEndTime)
        {
            yield return(new WaitForSeconds(endTime));

            foreach (ParticleSystem PS in ParticleSystems)
            {
                PS.Stop();
            }
        }
    }
Пример #12
0
    public void DailyRewardButton()
    {
        //If the player hasn't collected their daily reward yet
        if(!GS.collectedDailyReward)
        {
            //Provide them with the results of the reward according to its effect
            switch (todaysReward.effect)
            {
                case Item.Effect.ADDMONEY:
                    GS.IncreaseMoney(todaysReward.effectStrength);
                    break;
                case Item.Effect.ADDAUTOMATORS:
                    GS.AddAutoClick(todaysReward.effectStrength);
                    break;
                case Item.Effect.ADDLOOSECHANGE:
                    GS.IncreaseLooseChange(todaysReward.effectStrength);
                    break;
            }

            //Let the game state know they have collected it
            //And increment the reward counter so that tomorrow the reward will be different
            GS.collectedDailyReward = true;
            ++GS.currentDailyReward;
            if(GS.currentDailyReward >= GS.dailyRewards.Length)
            {
                GS.currentDailyReward = 0;
            }

            //Let them know that collecting the reward was successful
            notifyText.text = "Daily reward collected. Get another one tomorrow!";
            SFXManager.instance.PlayEffect(SoundEffectNames.FANFARETWO);

            foreach (ParticleSystem PS in fireworks)
            {
                PS.Play();
            }
        } else
        {
            //Remind the player they have already collected their daily reward
            notifyText.text = "You have already collected your daily reward!";
            SFXManager.instance.PlayEffect(SoundEffectNames.BUTTON);
        }
    }
Пример #13
0
 // Update is called once per frame
 void FixedUpdate()
 {
     if (velocitySet)
     {
         StartUpdate();
         if (firstIter)
         {
             foreach (ParticleSystem PS in allParticleSystems)
             {
                 PS.Play();
             }
             firstIter = false;
         }
         if (rigidbody.velocity != (moveVelocity * shotSpeed))
         {
             rigidbody.velocity = moveVelocity * shotSpeed;
         }
         EndUpdate();
     }
 }