32 lines
538 B
C#
32 lines
538 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
[Serializable]
|
|
public class Popupguiscript : MonoBehaviour
|
|
{
|
|
public Texture2D yourtexture;
|
|
|
|
public AudioClip popupsound;
|
|
|
|
public virtual void Update()
|
|
{
|
|
if (popupsound != null)
|
|
{
|
|
if (!GetComponent<AudioSource>().isPlaying)
|
|
{
|
|
GetComponent<AudioSource>().clip = popupsound;
|
|
GetComponent<AudioSource>().Play();
|
|
}
|
|
}
|
|
}
|
|
|
|
public virtual void OnGUI()
|
|
{
|
|
GUI.DrawTexture(new Rect(0f, 0f, Screen.width, Screen.height), yourtexture);
|
|
}
|
|
|
|
public virtual void Main()
|
|
{
|
|
}
|
|
}
|