public static RAKAudioClip[] toRakClips(AudioClip[] clips) { List <RAKAudioClip> rakList = new List <RAKAudioClip>(); foreach (AudioClip clip in clips) { RAKAudioClip rakClip = new RAKAudioClip(clip); rakList.Add(rakClip); } return(rakList.ToArray()); }
public void start(Transform master, RAKTerrainMaster masterTerrain, GameObject sun) { this.sun = sun; this.masterTerrain = masterTerrain; windZone = master.gameObject.GetComponent <WindZone>(); audioClips = new RAKAudioClip[2]; audioClips[0] = new RAKAudioClip(RAKUtilities.getAudioClip(RAKUtilities.AUDIO_CLIP_RAIN_LIGHT)); audioClips[1] = new RAKAudioClip(RAKUtilities.getAudioClip(RAKUtilities.AUDIO_CLIP_WIND_MEDIUM)); rainPrefab = RAKUtilities.getPrefab("RainPrefab"); audioSource = master.gameObject.AddComponent <AudioSource>(); audioSource.clip = audioClips[0].audioClip; audioSource.loop = true; windAudio = master.gameObject.AddComponent <AudioSource>(); windAudio.clip = audioClips[1].audioClip; windAudio.loop = true; setWeather(WeatherType.Clear); initialized = true; }