Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

play sound unity

AudioSource audioData;

    void Start()
    {
        audioData = GetComponent<AudioSource>();
        audioData.Play(0);
        Debug.Log("started");
    }
Comment

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 :: unity c# get direction of object 
Csharp :: roman to number 
Csharp :: count number of properties on an object C# 
Csharp :: Task.FromResult(null) 
Csharp :: event trigger by code unity 
Csharp :: dictionary order by value c# 
Csharp :: fluent assertions exception 
Csharp :: length of array c# unity 
Csharp :: how to open onscreen keyboard c# 
Csharp :: c# console password 
Csharp :: valid URL check in c# 
Csharp :: c# convert list t to datatable 
Csharp :: how to set picturebox width with form width in c# 
Csharp :: c# linq distinct group by nested list 
Csharp :: change working directory shell 
Csharp :: wpf resource dictionary 
Csharp :: on collision enter by layer 2d unity 
Csharp :: how to get type of an object in c# 
Csharp :: an existing connection was forcibly closed by the remote host. .net core 
Csharp :: socket io connect to namespace 
Csharp :: c# randize list 
Csharp :: vb.net add row to datagridview programmatically 
Csharp :: how to define a function in c# 
Csharp :: linq when name then orderby 
Csharp :: c# read all lines from filestream 
Csharp :: enum c# 
Csharp :: c# add 2 arrays 
Csharp :: input field to float unity 
Csharp :: yield in c# 
Csharp :: c# ternary operator 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =