项目场景:
通过传入数据调整Slider组件的value值,实现血量随数据更新
问题描述
通过GetComponent<>()
获取Slider
报错
ArgumentException: GetComponent requires that the requested component ‘Slider’ derives from MonoBehaviour or Component or is an interface.
using Tools;
using UI.Base;
using UnityEngine;
using UnityEngine.UIElements