Exemple #1
0
    void Update()
    {
        float value        = Mathf.InverseLerp(dbMin, 0, Mathf.Max(analyzer.GetDB(), dbMin));
        float decayedValue = Mathf.InverseLerp(dbMin, 0, Mathf.Max(analyzer.GetDBDecayed(), dbMin));

        bar.UpdateBar(value, decayedValue);
    }
Exemple #2
0
    // Update is called once per frame
    void Update()
    {
        var main = particleSystem.main;
        var db   = Mathf.InverseLerp(-64, 0, analyzer.GetDB());
        var band = analyzer.GetVisualScale(emitterYPosBand);

        main.startSpeed = db * speedFactor * band;
        float y = Mathf.Lerp(emitterYMin, emitterYMax, band);

        emitterTransform.position = new Vector3(emitterTransform.position.x, y, emitterTransform.position.z);
        particleSystem.Emit((int)(band * 500));
        var shape = particleSystem.shape;

        shape.arc = Mathf.Lerp(60, 360, db);
    }