using System; using System.Collections; using System.Collections.Generic; using DG.Tweening; using UnityEngine; public class HpIcon : MonoBehaviour { [Header("增加血量")] public float hpAdd = 1000; public Collider box; public GameObject hpIcon; public GameObject txt; public void Start() { hpIcon.transform.DORotate(new Vector3(0f, 360f, 0f), 5f, RotateMode.LocalAxisAdd).SetLoops(-1, LoopType.Restart); } public void ColliderHpIcon() { box.enabled = false; transform.gameObject.SetActive(false); Destroy(transform.gameObject); } private void Update() { txt.transform.parent.GetComponent().LookAt(GameInit.Ins.playerCam.transform); } }