Search Unity

Why I don't see the Dynamic methods in the On Value Changed () event/s ?

Discussion in 'Scripting' started by DubiDuboni, Sep 14, 2019.

  1. DubiDuboni

    DubiDuboni

    Joined:
    Feb 5, 2019
    Posts:
    131
    This is script is attached to a Canvas.

    Code (csharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5. using UnityEngine.Audio;
    6.  
    7. public class SettingsMenu : MonoBehaviour
    8. {
    9.    public AudioMixer audioMixer;
    10.  
    11.    public void SetVolume(float volume)
    12.    {
    13.        audioMixer.SetFloat("Volume", volume);
    14.    }
    15.  
    16.    public void SetQuality(int qualityIndex)
    17.    {
    18.        QualitySettings.SetQualityLevel(qualityIndex);
    19.    }
    20. }
    21.  
    And then under it in the Hierarchy for example I have Graphics a DropDown ui. And on the Graphics in the Inspector at the bottom in On Value Changed I dragged the Canvas over but then when I click on No Function > SettingsMenu I can see the SetQuality method but there should be also SetQuality at the top under Dynamic int and it's not there :



    Same problem with the SetVolume method. And I had this Dynamic float/int before but they are not exist now.
     
  2. nilsdr

    nilsdr

    Joined:
    Oct 24, 2017
    Posts:
    374
    This implies the value passed in onvaluechanged doesn't or isn't gauranteed to match the function parameter datatype.
     
    DubiDuboni likes this.
  3. DubiDuboni

    DubiDuboni

    Joined:
    Feb 5, 2019
    Posts:
    131
    But it was working before. I saw the Dynamic int/float.
    I don't understand what should I change/add in the script. I didn't change anything.
     
  4. nilsdr

    nilsdr

    Joined:
    Oct 24, 2017
    Posts:
    374
  5. JoeJoe

    JoeJoe

    Joined:
    Mar 22, 2013
    Posts:
    8