右键引用
,添加引用
找到unity 安装目录下的:EditorDataManaged
using UnityEngine;
namespace ClassLibrary
{
public class TestMono:MonoBehaviour
{
[SerializeField,Header("当前进度")]
private float currentProgress = 0;
[Header("进度更新事件")]
public UnityEngine.Events.UnityEvent<float> onProgressEvent;
void Start ()
{
Debug.Log(gameObject.name);
}
void Update() {
if(Input.GetKeyDown(KeyCode.Escape))
{
UpdateProgress(currentProgress+0.1f);
}
}
public void UpdateProgress(float progress) {
currentProgress =Mathf.Clamp01(progress);
onProgressEvent?.Invoke(progress);
}
}
}
把dll 复制到项目中,直接把Mono类拖到物体上即可
原文地址:https://blog.csdn.net/qq_26318597/article/details/135871494
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_63053.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!