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,48 @@
using Manager;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Teleport : MonoBehaviour
{
public BossAI m;
public bool isBattle;
private void Awake()
{
if(isBattle)
{
m = GameObject.FindWithTag("Boss").GetComponentInChildren<BossAI>();
}
}
private void OnTriggerEnter2D(Collider2D collision)
{
if(isBattle)
{
if (m.GetIsDie() && collision.CompareTag("Player"))
{
Debug.Log("传送");
//保存玩家信息
CharacterCombat cm = collision.gameObject.GetComponentInChildren<CharacterCombat>();
PlayerInfo.Instance.KeepData(cm.maxHp, cm.currentHp, cm.attack);
UIManager.Instance.Show<UILoad>();
return;
}
}
else
{
if (collision.CompareTag("Player"))
{
Debug.Log("传送");
//保存玩家信息
CharacterCombat cm = collision.gameObject.GetComponentInChildren<CharacterCombat>();
PlayerInfo.Instance.KeepData(cm.maxHp,cm.currentHp,cm.attack);
UIManager.Instance.Show<UILoad>();
return;
}
}
}
}