示例#1
0
 public static AudioData[] EditAudioDataArray(GameObject gameObject,
                                              AudioData[] AudioDataArray)
 {
     if (GUILayout.Button("Add Audio Data"))
     {
         AudioData audioData = new AudioData();
         AudioDataArray = Util.AddToArray <AudioData> (audioData, AudioDataArray);
     }
     for (int i = 0; i < AudioDataArray.Length; i++)
     {
         AudioData audio = AudioDataArray [i];
         EditorGUILayout.LabelField("------------------------ " + audio.Name);
         audio.Name             = EditorGUILayout.TextField(new GUIContent("Name", ""), audio.Name);
         audio.randomAudioClips = EditorCommon.EditObjectArray <AudioClip>("Edit Audio clips:", audio.randomAudioClips);
         //Delete this audio data
         if (GUILayout.Button("Delete AduioData:" + audio.Name))
         {
             AudioDataArray = Util.CloneExcept <AudioData> (AudioDataArray, audio);
         }
     }
     EditorGUILayout.Space();
     return(AudioDataArray);
 }