B
B
bgg1232021-01-06 21:56:47
Unity
bgg123, 2021-01-06 21:56:47

Why can't I select Dynamic float in OnValue Changed? With what it can be connected?

I have a menu and there are three items: play, settings and exit. Initially, there were two buttons (play and exit) and I decided to use this guide https://habr.com/en/post/346370/ to set up the sound. I did everything according to the guide, and when I assigned the method to the sound slider, the Dynamic float field was gray and did not want to get out. What could be the problem? I'm new so this might be a stupid question. Here is the menu script.

using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.SceneManagement;

public class Menu : MonoBehaviour {
public AudioMixer am;

public void AudioVolume(float sliderValue)
{
am.SetFloat("Music", sliderValue);
}

 // Use this for initialization
void Start () {
     Cursor.lockState = CursorLockMode.None;
        Cursor.visible = true;
    GameSettings.curCount = 0;
  }
  
 // Update is called once per frame
 void Update () {
  
 }

 public void NewGame()
 {
 Cursor.visible=false;
  SceneManager.LoadScene(1);
 }
 public void Exit()
 {
  Application.Quit();
 }
 public void Restart()
 {
  SceneManager.LoadScene(0);
  }
  public void ToMenu()
 {
  SceneManager.LoadScene(0);
  }
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question