using UnityEngine;namespace Unity.FPS.UI
{
// The component that is used to display the Objectives, the Notification and the game messages like a list// When a new one is created, the previous ones move down to make room for the new onepublicclassUITable:MonoBehaviour{
[Tooltip("How much space should there be between items?")]publicfloat Offset;[Tooltip("Add new the new items below existing items.")]publicbool Down;publicvoidUpdateTable(GameObject newItem){
if(newItem !=null)
newItem.GetComponent<RectTransform>().localScale = Vector3.one;float height =0;for(int i =0; i < transform.childCount; i++){
RectTransform child = transform.GetChild(i).GetComponent<RectTransform>();Vector2 size = child.sizeDelta;
height += Down ?-(1- child.pivot.y)* size.y :(1- child.pivot.y)* size.y;if(i !=0)
height += Down ?-Offset : Offset;Vector2 newPos = Vector2.zero;
newPos.y = height;
newPos.x =0;//-child.pivot.x * size.x * hi.localScale.x;
child.anchoredPosition = newPos;}}}}
using System;using UnityEngine;namespace Unity.FPS.Game
{
publicabstractclassObjective:MonoBehaviour{
[Tooltip("Name of the objective that will be shown on screen")]publicstring Title;protectedvirtualvoidStart(){
DisplayMessageEvent displayMessage = Eve
1.准心判定2.UI提示2.1 敌人血条WorldHealthBar:using Unity.FPS.Game;using UnityEngine;using UnityEngine.UI;namespace Unity.FPS.UI{ public class WorldspaceHealthBar : MonoBehaviour { [Tooltip("Health component to track")] public Health Health