Client/C# with Unity

[정보] Unity Toggle 스크립트에서 listener 추가하는 방법. Toggle.onValueChanged.AddListener

Ardmos :) 2022. 1. 6. 01:02

 

위 내용처럼 delegate를 사용해 메서드를 전달해주면 됩니다.

 

onValueChanged.AddListener(delegate{ '실행할 메서드' })

 

 

 

 

https://docs.unity3d.com/2019.1/Documentation/ScriptReference/UI.Toggle-onValueChanged.html

 

Unity - Scripting API: UI.Toggle.onValueChanged

You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see: You've told us there are code samples on this page which don't work. If you know ho

docs.unity3d.com

 

 

 

728x90