Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity sound

using System.Collections;
using UnityEngine;

public class AudioManager : MonoBehaviour
{
    [SerializeField]
    private AudioSource sampleAudioSource = null;

    void Awake(){
		if (sampleAudioSource == null)
            Debug.LogError("AUDIO_MANAGER: sampleAudioSource is NULL");
    }

    public void PlaySampleSound()
	{
    	sampleAudioSource.Play();
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# convert enum to list 
Csharp :: c# close 1 form open another form 
Csharp :: How can I cast string to enum? 
Csharp :: iterate through xpdictionary devexpress 
Csharp :: c# get files of type in directory 
Csharp :: unity get a position inside sphere 
Csharp :: convert int to string in linq query c# 
Csharp :: c# two different random numbers 
Csharp :: unity get selected gameobject 
Csharp :: how to parse a string to an integer c# 
Csharp :: data table rename column c# 
Csharp :: c# display a variable to a text gameobject 
Csharp :: convert dto to dictionary c# 
Csharp :: unity get child 
Csharp :: stop flickering 
Csharp :: how to add reference to rigidbody 2d 
Csharp :: c# get month number from name 
Csharp :: c sharp array to list 
Csharp :: unity cast float to int 
Csharp :: bootstrap distane between col 
Csharp :: c# postmessage mouse click 
Csharp :: c# inline a function 
Csharp :: pyqt qtableview get selected row data 
Csharp :: unity how get random color to material 
Csharp :: asp.net model display name 
Csharp :: loop datagridview c# 
Csharp :: C# push list 
Csharp :: c# number in range 
Csharp :: asking for user input integer c# 
Csharp :: unity joystick movement 2d 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =