using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
///
/// 重点保护目标
///
public class HighPriorityTarget : MonoBehaviour
{
///
/// 重点保护目标集合
///
public static List HighPriorityTargets = new List();
///
/// 重点设备完整度
///
public static float EquipmentIntegrity = 1;
#region 单体保护目标属性
///
/// 单体保护目标属性血量
///
public float HP = 100;
#endregion
///
/// 重点目标UI看向摄像机
///
public Transform KeyObjectiveUI;
///
/// 爆炸预制体
///
public GameObject explodePrefab;
///
/// 完整模型
///
public GameObject ModerFull;
///
/// 损坏模型
///
public GameObject ModerDamage;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Camera.main)
KeyObjectiveUI.transform.LookAt(Camera.main.transform);
}
///
/// 被攻击
///
public void BeAssaulted(Vector3 Pos)
{
HP -= 10;
GameObject Bao = Instantiate(explodePrefab, transform);
Bao.transform.localPosition = Pos;
Bao.transform.SetParent(null);
Bao.SetActive(true);
if (HP < 50)
{
ModerFull.SetActive(false);
ModerDamage.SetActive(true);
}
}
}