Horje
pause audio unity Code Example
pause audio unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;


public AudioSource MyAudioSource; //put your object in inspector that have the audio


void Update(){


if (Input.GetKeyDown(KeyCode.Escape)) //When press ESC to pause the game
        {
            if (Time.timeScale == 0)
            {
                MyAudioSource.Stop();
            }
            else
            {
                MyAudioSource.Play();
            }
        }
        
        }
audio source pause unity

using UnityEngine;[RequireComponent(typeof(AudioSource))]
public audioSource audioSource  = GetComponent<AudioSource>();

void Start();{
	audioSource.Pause();
}





Csharp

Related
how to change the title of the console in c# Code Example how to change the title of the console in c# Code Example
stop audio unity Code Example stop audio unity Code Example
mailkit send attachment Code Example mailkit send attachment Code Example
unity public static variable Code Example unity public static variable Code Example
new Color from hex in unity Code Example new Color from hex in unity Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9