网上演练贵港万达广场(人员密集)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.4 KiB

4 years ago
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CreatHaemalUI : MonoBehaviour
{
private GameObject prefabs;
public GameObject haemal;
private Transform Haemalpanel;
// Use this for initialization
void Start()
{
Haemalpanel = GameObject.Find("Canvas").transform.Find("HaemalPanel").transform;
4 years ago
//因为指挥中心不在主场景
if (CurrentUserInfo.role!=Role.&&CurrentUserInfo.role!=Role.)
{
prefabs = Resources.Load<GameObject>("Common/BGBlood");
haemal = Instantiate(prefabs, Haemalpanel);
haemal.name = gameObject.name;
haemal.GetComponent<HaemalStrand>().TargetObj = gameObject;
if (GetComponent<BaseGameObjInfo>().gameObjType == CloneObjType.wounded)
{
haemal.GetComponent<HaemalStrand>().Haemal = 50;
}
if (GetComponent<BaseGameObjInfo>().gameObjType == CloneObjType.trappedPerson)
{
haemal.GetComponent<HaemalStrand>().Haemal = 100;
}
}
}
// Update is called once per frame
void Update()
{
}
public void OnDestroy()
{
if (haemal != null)
{
Destroy(haemal);
}
}
public void OnDisable()
{
if(haemal!=null)
{
haemal.gameObject.SetActive(false);
}
}
}