2021-12-25 18:27:29 +08:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.SceneManagement;
|
|
|
|
using DG.Tweening;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取死亡列表的时候用这个
|
|
|
|
/// </summary>
|
|
|
|
public class GetDateBaseDead : MonoBehaviour
|
|
|
|
{
|
|
|
|
|
|
|
|
public GameObject deadPlayer;
|
|
|
|
public List<DeadInfo> deadInfos;
|
|
|
|
|
|
|
|
public void Get(){
|
|
|
|
//将所有死亡信息拉到本地
|
|
|
|
deadInfos = GetComponent<PlayerInfo>().GetDeadInfo(SceneManager.GetActiveScene().buildIndex);
|
|
|
|
//筛选出10条
|
|
|
|
while(deadInfos.Count > 10){
|
|
|
|
deadInfos.RemoveAt(Random.Range(0,deadInfos.Count));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Show(){
|
2021-12-27 00:07:25 +08:00
|
|
|
if(deadInfos == null) deadInfos = new List<DeadInfo>();
|
2021-12-25 18:27:29 +08:00
|
|
|
//初始化所有死亡玩家
|
|
|
|
foreach(DeadInfo info in deadInfos){
|
|
|
|
//创建一个死亡玩家
|
|
|
|
GameObject temp = Instantiate(deadPlayer,info.postion,Quaternion.identity);
|
|
|
|
//根据信息初始化这个玩家
|
|
|
|
temp.transform.position = info.postion;
|
|
|
|
//淡入显示死亡玩家
|
|
|
|
temp.GetComponent<SpriteRenderer>().DOFade(
|
|
|
|
0.6f,
|
|
|
|
0.5f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|