|
I made a class like this
and on the Inspector, it appears like this
Here's the problem I want to drag and drop a audio file to the 'None' area. But I have no idea what I have to do. I want to look like this
And I want to look exactly like above.. because I wanna make a array for AudioClipPlayer like this
I want to make that Unity recognize AudioClipPlayer to AudioClip. Is that possible? Thx for reading.
(comments are locked)
|
|
Remove the : Object for a start, it'll be making your class inherit UnityEngine.Object which makes very little sense. After that, you'll want to either make the fields public, or add [SerializeField] above both of them
or thank you Mike. but I want exactly looking like above.. because I wanna make a array for AudioClipPlayer like this [System.Serializable] public class ZombiAudioClips { public AudioClipPlayer[] idleClips; }
Jan 04 '11 at 10:10 AM
planC
Then it can't work. If you change it to how i'm saying, it should work as you want it. I'll add in a fixed class as an example
Jan 04 '11 at 10:19 AM
Mike 3
I would go with the top example, the bottom one is probably going to have protection issues trying to access the private members
Jan 04 '11 at 10:22 AM
Mike 3
It does not work for the code 'AudioClipPlayer[] idleClips'. I want to add some audio files to idleClips.
Jan 04 '11 at 10:43 AM
planC
Which one are you trying?
Jan 04 '11 at 11:01 AM
Mike 3
(comments are locked)
|
