1
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7bba0cc35dabde64da5b08e8c99eefc5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user