add:添加音频,添加事件系统

This commit is contained in:
bzx
2026-03-03 18:45:27 +08:00
parent bc3ebb3864
commit 5c19ebcbf8
182 changed files with 14220 additions and 11974 deletions

View File

@@ -45,17 +45,13 @@ public class GameManager : MonoBehaviour
public float vistEnd = 60 * 10;
public float curGameTime = 0;
public GameObject wuHui;
//预制体
public GameObject playerPre;
public GameObject enemyPre;
public GameObject gemKeyPre;
public GameObject eggBulletPre;
public GameObject eggBulletExPre;
public GameObject gameStartDoor;
public GameObject mirrorPre;
public GameObject witchPre;
public RightHand playerRightHand;
public Enemy enemy;
@@ -89,31 +85,14 @@ public class GameManager : MonoBehaviour
private void Start()
{
isStartGame = false;
wuHui.SetActive(false);
// 新增:初始化指引系统
}
public void GameStart()
{
CreateAICharacter();
CleanupGuideArrow();
//isStartGame = true;
//HUDPanel.Show();
//taskManager.bg.SetActive(true);
//CreateEnemy(GameLocal.Ins.enemyPos.position, new Vector3(0,180,0));
//宝石任务
//enemy.SetState(1);
//taskManager.curTaskId = 1;
//拔萝卜任务
// enemy.SetState(2);
// taskManager.curTaskId = 2;
//换装任务
//taskManager.curTaskId = 3;
//taskManager.StartTask();
//打鸡蛋任务
//enemy.SetState(3);
//taskManager.curTaskId = 4;
//taskManager.StartTask();
//CreateAICharacter();
//CleanupGuideArrow();
//CreateEnemy(GameLocal.Ins.enemyPos.position,GameLocal.Ins.enemyPos.eulerAngles);
}
//修改处添加创建AI角色的方法
@@ -305,22 +284,12 @@ public class GameManager : MonoBehaviour
enemy = curEnemy.GetComponent<Enemy>();
}
public GameObject CreateGemKey(Vector3 pos,Vector3 eulerAngles,Transform box)
public void CreateMirrorPre()
{
var key= Instantiate(gemKeyPre, pos,Quaternion.identity,box);
key.transform.localEulerAngles = eulerAngles;
key.transform.localPosition = pos;
return key;
}
public void CreateEggEx(Vector3 pos)
{
var eggEx= Instantiate(eggBulletExPre, pos,Quaternion.identity);
PlaySound2DRPC("1.23");
MonoSingleton<CoroutineTaskManager>.Instance.WaitSecondTodo(() =>
{
Destroy(eggEx);
},5f);
var curMirror=Instantiate(mirrorPre,GameLocal.Ins.mirrorPos.position,Quaternion.identity);
curMirror.transform.eulerAngles = GameLocal.Ins.mirrorPos.eulerAngles;
curMirror.GetComponent<Enemy>().Init();
//enemy = curEnemy.GetComponent<Enemy>();
}
public void PlayerHit()
@@ -339,7 +308,6 @@ public class GameManager : MonoBehaviour
return;
enemy.Hit();
PlaySound3DRPC("1.49",enemy.transform,true);
CreateEggEx(pos);
}
public void EnemyTimeHit()
@@ -362,7 +330,6 @@ public class GameManager : MonoBehaviour
//开启舞会
Debug.LogError("开启舞会场景");
PlayBGM(1);
wuHui.SetActive(true);
taskManager.bg.SetActive(false);
MonoSingleton<CoroutineTaskManager>.Instance.WaitSecondTodo(() =>
{
@@ -370,7 +337,6 @@ public class GameManager : MonoBehaviour
},10f);
MonoSingleton<CoroutineTaskManager>.Instance.WaitSecondTodo(() =>
{
wuHui.SetActive(false);
Application.Quit();
}, 90f);