修复问题,优化bug和游戏,resource资源拆迁

This commit is contained in:
2026-02-24 20:59:38 +08:00
parent d5c8966abd
commit 332307d18c
740 changed files with 6964 additions and 23604 deletions
+35
View File
@@ -0,0 +1,35 @@
using UnityEngine;
public class OpAudioPlayer : MonoBehaviour
{
public AudioSource audioSource;
void Start()
{
if (audioSource == null)
{
audioSource = GetComponent<AudioSource>();
if (audioSource == null)
{
Debug.LogError("OpAudioPlayer: 找不到 AudioSource 组件。请确保组件已添加或在 Inspector 中设置。");
return;
}
}
audioSource.loop = true;
if (!audioSource.isPlaying)
{
audioSource.Play();
}
}
private void OnDestroy()
{
if (audioSource != null && audioSource.isPlaying)
{
audioSource.Stop();
}
}
}