Quantcast
Channel: Questions in topic: "get"
Viewing all articles
Browse latest Browse all 215

how do i get property by name out of an object?

$
0
0
so i have this class for example: public class Sounds : Monobehaviour { public AudioClip Click1; public AudioClip Click2; public AudioClip Click3; } Now, i wanna get one of the audioclips by name public AudioClip getAudioClip (string name) { return Audioclip named name; } now i wanna get the audoclip click2 by entering "Click2", how do i do that?

Viewing all articles
Browse latest Browse all 215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>