1 首先我们先来插图两幅图片
2 代码演示
using UnityEngine;
using System.Collections;
//插入UI组件
using UnityEngine.UI;
public class new_1 : MonoBehaviour {
// 音频源
public AudioSource music;
public bool var = false;
public GameObject audios;
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
}
public void URLW()
{
Application.OpenURL(“http://www.bjiba.com.cn/“);
}
public void AudioOe()
{
if (var == false)
{
music.Stop();
var = true;
点击暂停之后切换为蓝色,播放之后变为白色
audios.GetComponent().color = Color.blue;
}
else if (var == true)
{
music.Play();
var = false;
audios.GetComponent().color = Color.white;
}
}
}