a guest Apr 18th, 2019 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- AudioClip clip = new WWW("File:///" + Application.streamingAssetsPath + "/AudioFile.ogg").GetAudioClipCompressed();
- //--You can use this audio clip in several ways.
- //Play it as a background music
- JukeboxScript j = FindObjectOfType<JukeboxScript>();
- j.Custom.clip = clip;
- //Just play it one shot
- AudioSource src = FindObjectOfType<AudioListener>().gameObject.AddComponent<AudioSource>();
- src.clip = clip;
- //Play it attached to the game object
- GameObject clipOwner = new GameObject();
- AudioClipPlayer.PlayAttached(clip, attachedGameObj.transform.position, attachedGameObj.transform, 1f, maxDistance, out clipOwner, Yandere.transform.position.y);
RAW Paste Data