using System.Collections; using System.Collections.Generic; using UnityEngine; public class cs02 : MonoBehaviour { public AudioClip au1, au2; void OnMouseDown() { GameObject.Find("Cube").GetComponent().material.color = Color.blue; GameObject.Find("Cube").GetComponent().clip = au1; GameObject.Find("Cube").GetComponent().Play(); } void OnMouseUp() { GameObject.Find("Cube").GetComponent().material.color = Color.white; GameObject.Find("Cube").GetComponent().clip = au2; GameObject.Find("Cube").GetComponent().Play(); } }