新增game hud字体
移除旧版血量控制
This commit is contained in:
@@ -1,18 +1,25 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Billboard 脚本 —— 让 Sprite 始终面朝相机,消除透视相机角度导致的 Sprite 变形。
|
||||
/// 挂到怪物/角色根物体上即可。
|
||||
/// </summary>
|
||||
public class facingcamera : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
private Camera _cam;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
|
||||
_cam = Camera.main;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
private void LateUpdate()
|
||||
{
|
||||
|
||||
if (_cam == null) return;
|
||||
// 让物体的 forward (Z+) 指向相机,Sprite 平面自然朝向相机
|
||||
transform.LookAt(
|
||||
transform.position + (_cam.transform.position - transform.position),
|
||||
Vector3.up
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user