Exemple #1
0
    /// <summary>
    /// Spawn particles coroutine.
    /// </summary>
    /// <returns>IEnumerator</returns>
    private IEnumerator SpawnParticlesCoroutine()
    {
        if (_audio == null)
        {
            _audio = GetComponent <AudioComponent>();
            _audio.Init();
        }
        _audio.PlaySound();

        foreach (GameObject particle in particles)
        {
            particle.SetActive(true);
        }

        yield return(new WaitForSeconds(waitForRemoving));

        foreach (GameObject particle in particles)
        {
            particle.SetActive(false);
        }
        _spawnParticlesRoutine = null;
    }