Выдает ошибку: error CS1061: 'AudioMixer' does not contain a definition for 'SetFloat' and no accessible extension method 'SetFloat' accepting a first argument of type 'AudioMixer' could be found (are you missing a using directive or an assembly reference?)
Код
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
public class AudioMixer : MonoBehaviour
{
public AudioMixer am;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void AudioVolume(float sliderValue)
{
am.SetFloat("masterVolume", sliderValue);
}
}