dronkowitz

AudioObject.cs (Sonic Heroes)

Jan 13th, 2021 (edited)
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class AudioObject : MonoBehaviour
  6. {
  7.     AudioSource source;
  8.     public void Setup(AudioClip sound, Transform target)
  9.     {
  10.         source = GetComponent<AudioSource>();
  11.         source.clip = sound;
  12.         transform.position = target.position;
  13.         source.Play();
  14.     }
  15.  
  16.     // Update is called once per frame
  17.     void Update()
  18.     {
  19.  
  20.     }
  21. }
Add Comment
Please, Sign In to add comment