Esempio n. 1
0
    public void Emit(Vector3 position, int beat, int gen)
    {
        if (gen == 1)
        {
            if (beat > currentBeat)
            {
                count++;
                currentBeat = beat;
                size       *= 2.5f;
            }

            if (count > 2)
            {
                count = 0;
                size  = 3f;
            }

            if (beat == 0)
            {
                count       = 0;
                currentBeat = 0;
                size        = 3f;
            }
        }


        // Debug.Log($"beat is {beat}, currentBeat is {currentBeat}, count is {count}");
        instance = Instantiate(particle, position, transform.rotation);
        instance.transform.localScale = new Vector3(size, size, size);
        instanceScript = instance.GetComponent <Particle>();
        instanceScript.SetManager(this);
        instanceScript.BeatColour(beatColour[count]);
        instanceScript.SetParticleType(beat);
        // Handheld.Vibrate();
    }