This commit is contained in:
JA
2026-06-20 19:34:23 +08:00
parent e5031c0068
commit d442805c3f
4136 changed files with 514641 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
public class SceneMonsterManager : MonoBehaviour
{
[SerializeField, Header("怪物列表")] private List<GameObject> monsters = new List<GameObject>();
[SerializeField, Header("怪物生成速率")] private float timer;
public Transform teleporte;
public bool isTeleport = false;
public GameObject box;
private int count = 0;
private float t = 0;
private void Awake()
{
foreach (var item in monsters)
{
item.SetActive(false);
}
}
private void Update()
{
t += Time.deltaTime;
if (t >= timer)
{
Debug.Log(isTeleport);
ABC();
ProtectedMonster();
}
}
void ProtectedMonster()
{
if (count >= monsters.Count)
{
return;
}
monsters[count].SetActive(true);
count += 1;
t = 0;
}
void ABC()
{
if(transform.childCount==0&&!isTeleport)
{
//UIManager.Instance.Show<UILottery>();
Instantiate(box);
isTeleport = true;
}
}
}