Example #1
0
 // Update is called once per frame
 void Update()
 {
     if (!m_particleSystem.isEmitting)
     {
         m_particleSystem.Stop();
         SmokeGenerator.SmokeFinished(gameObject);
     }
 }
Example #2
0
 void Awake()
 {
     if (SmokeGenerator.instance == null)
     {
         SmokeGenerator.instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
    public void AudioRhythm()
    {
        if (!playedAudio)
        {
            SwitchTimeScale();
            playedAudio = true;
        }
        else
        {
            if (!beatSource.isPlaying)
            {
                if (changeRhythm)
                {
                    float randomChance = Random.Range(0, 100);

                    if (randomChance > 50)
                    {
                        RandomClip();
                        RandomTempo();
                    }

                    changeRhythm = false;
                }

                SwitchTimeScale();
                playedAudio = false;
            }
        }

        //for showing smoke when a note is destined to play
        if (showRhythm)
        {
            animator.Play();
            smokeGen = smokeParticles[smokeCounter].GetComponent <SmokeGenerator>();
            smokeGen.SmokeIt();
            smokeParticles[smokeCounter].Play();
            showRhythm = false;

            if (smokeCounter < 2)
            {
                smokeCounter++;
            }
            else
            {
                smokeCounter = 0;
            }
        }
    }
Example #4
0
    private void HandleHit()
    {
        m_curHits++;

        if (m_curHits > brickSprites.Length)
        {
            Brick.DestructibleBrickCount--;
            m_levelManager.BrickDestroyed();

            SmokeGenerator.TriggerSmoke(gameObject);
            Destroy(gameObject);
        }
        else
        {
            LoadNextSprite();
        }
    }