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.
|
|
|
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;
|
|
|
|
//因为指挥中心不在主场景
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|