48 lines
893 B
C#
48 lines
893 B
C#
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
using UnityEngine.UI;
|
||
using UnityEngine.SceneManagement;
|
||
|
||
|
||
public class MusicOnOff : MonoBehaviour
|
||
{
|
||
public Sprite[] spriteMute; //0 = on, 1 = off
|
||
public Button buttonMute;
|
||
void Start()
|
||
{
|
||
if (Music.Instance.music.mute == true)
|
||
{
|
||
buttonMute.image.sprite = spriteMute[1];
|
||
}
|
||
else
|
||
{
|
||
buttonMute.image.sprite = spriteMute[0];
|
||
}
|
||
}
|
||
|
||
void Update()
|
||
{
|
||
|
||
}
|
||
|
||
public void ButtonIngame()
|
||
{
|
||
SceneManager.LoadScene(1);
|
||
}
|
||
|
||
public void ButtonMute()
|
||
{
|
||
Music.Instance.MuteSound();
|
||
if (Music.Instance.music.mute == true)
|
||
{
|
||
buttonMute.image.sprite = spriteMute[1];
|
||
}
|
||
else
|
||
{
|
||
buttonMute.image.sprite = spriteMute[0];
|
||
}
|
||
}
|
||
}
|
||
|