Exemplo n.º 1
0
    public void Pluck()
    {
        float pitch  = SpiralManager.YPitchOffset * 440f * pitchMultiplier * Mathf.Pow(2f, SpiralManager.PitchDegree * transform.position.y);
        float volume = Mathf.Pow(0.4f + 0.1f * Width * Mathf.Lerp(1f, Tapering, Length / TargetLength), 4);

        Synth y_synth = SynthManager.Instance.RequestSynth(SpiralManager.Instance.SynthPrefab);

        y_synth.Source.panStereo = transform.position.x / 10f;
        y_synth.PlayPitch(pitch, volume);
        SynthManager.Instance.ReleaseSynth(y_synth, false);
    }