1
This commit is contained in:
39
unity/Assets/Script/UI/UIEnterScene.cs
Normal file
39
unity/Assets/Script/UI/UIEnterScene.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class UIEnterScene : UIWindow
|
||||
{
|
||||
public Image headImage;
|
||||
public Text bossNameText;
|
||||
|
||||
public GameObject bossHp;
|
||||
public GameObject enterUI;
|
||||
public BossAI Boss;
|
||||
|
||||
public void InitInfo(Sprite head,string bossName)
|
||||
{
|
||||
headImage.overrideSprite = head;
|
||||
bossNameText.text = bossName;
|
||||
|
||||
StartCoroutine(nameof(SetActive));
|
||||
}
|
||||
private IEnumerator SetActive()
|
||||
{
|
||||
yield return new WaitForSeconds(1.5f);
|
||||
|
||||
Boss = GameObject.FindWithTag("Boss").GetComponentInChildren<BossAI>();
|
||||
if (Boss != null)
|
||||
{
|
||||
bossHp.SetActive(true);
|
||||
bossHp.GetComponent<CharacterHp>().Init(Boss);
|
||||
}
|
||||
enterUI.SetActive(false);
|
||||
}
|
||||
|
||||
public void UpdateInfo()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user