I_wanna_be_a_Fox/Assets/Script/SoundControler.cs
Koha9 a80f3d6560 I wanna be a fox first commit.
Initial commit. Complete project for 'I Wanna Be A Fox' - a 2D scrolling game inspired by 'I Wanna Be The Guy'.
2024-02-22 07:27:59 +09:00

26 lines
487 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SoundControler : MonoBehaviour {
public AudioClip Sound;
private AudioSource m_AudioSource;
// Use this for initialization
void Start () {
m_AudioSource = GetComponent<AudioSource>();
}
// Update is called once per frame
void Update () {
m_AudioSource.clip = Sound;
}
public void Play()
{
m_AudioSource.Play();
}
}