48 lines
1.2 KiB
C#
48 lines
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using DragonLi.Core;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using Valheim;
|
|
using XUI;
|
|
|
|
public class WinAreaPanel : UIBehaviour
|
|
{
|
|
public static void Show(int petCount)
|
|
{
|
|
WorldUIManager.Ins.Cover("UI/WinAreaPanel", false,petCount);
|
|
}
|
|
|
|
public TMP_Text petCountTxt;
|
|
public Image[] badges;
|
|
|
|
public Image[] petImg;
|
|
|
|
public override void OnUIShow(params object[] args)
|
|
{
|
|
base.OnUIShow(args);
|
|
int petCount = (int)args[0];
|
|
petCountTxt.text = petCount.ToString();
|
|
int petId = GameManager.Ins.userPet.id;
|
|
if (petId == 1)
|
|
{
|
|
(petImg[0].sprite, petImg[1].sprite) = (petImg[1].sprite, petImg[0].sprite);
|
|
}
|
|
if (petId == 3)
|
|
{
|
|
(petImg[0].sprite, petImg[2].sprite) = (petImg[2].sprite, petImg[0].sprite);
|
|
}
|
|
|
|
for (int i = 0; i < badges.Length; i++)
|
|
{
|
|
badges[i].gameObject.SetActive(GameManager.Ins.curMapId==i);
|
|
}
|
|
|
|
MonoSingleton<CoroutineTaskManager>.Instance.WaitSecondTodo(() =>
|
|
{
|
|
WorldUIManager.Ins.Back();
|
|
},7f);
|
|
}
|
|
}
|