当前位置: 首页 > news >正文

Unity MonoBehaviour 生成dll

dllllllllllllll🥓

  • 🥙vs创建类库项目
  • 🧀添加UnityEngine、UnityEditor引用
  • 🍕添加MonoBehaviour类
  • 🦪设置dll生成路径
  • 🍿生成dll
  • 🍔使用dll中的Mono类

🥙vs创建类库项目

在这里插入图片描述

🧀添加UnityEngine、UnityEditor引用

右键引用,添加引用
在这里插入图片描述

在这里插入图片描述

找到unity 安装目录下的:\Editor\Data\Managed
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

🍕添加MonoBehaviour类

在这里插入图片描述
在这里插入图片描述

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生成路径

在这里插入图片描述

🍿生成dll

请添加图片描述
在这里插入图片描述

🍔使用dll中的Mono类

把dll 复制到项目中,直接把Mono类拖到物体上即可
请添加图片描述

http://www.lryc.cn/news/289224.html

相关文章:

  • 基于Python flask MySQL 猫眼电影可视化系统设计与实现
  • 【新课上架】安装部署系列Ⅲ—Oracle 19c Data Guard部署之两节点RAC部署实战
  • gdb调试std::list和std::vector等容器的方法
  • python stomp 转发activemq topic消息
  • Spring Boot使用AOP
  • C语言通过IXMLHttpRequest以get或post方式发送http请求获取服务器文本或xml数据
  • QtRVSim(二)一个 RISC-V 程序的解码流程
  • x-cmd pkg | httpx - 为 Python 设计的下一代 HTTP 客户端库
  • 代码随想录算法训练营第四十二天(动态规划篇)|62. 不同路径
  • YOLO 全面回顾:从最初的YOLOv1到最新的YOLOv8、YOLO-NAS,以及整合了 Transformers 的 YOLO
  • Android双指缩放ScaleGestureDetector检测放大因子大图移动到双指中心点ImageView区域中心,Kotlin(2)
  • 同为科技(TOWE)自动控制循环定时插座
  • 游戏设计模式
  • CUBEMX与FreeRTOS在Arm Compiler 6下的配置方法
  • Android Studio 提示Use app:drawableStartCompat instead of android:drawableStart
  • C# wpf 实现任意控件(包括窗口)更多调整大小功能
  • Vue+OpenLayers7入门到实战:快速搭建Vue+OpenLayers7地图脚手架项目。从零开始构建Vue项目并整合OpenLayers7.5.2
  • mysql-线上常用运维sql
  • Linux之进程间通信(system V 共享内存)
  • 数据库 sql select *from account where name=‘张三‘ 执行过程
  • 力扣日记1.27-【回溯算法篇】131. 分割回文串
  • 如何用web界面打开华为防火墙
  • 力扣20、有效的括号(简单)
  • Android 系统启动过程
  • 基于STM32的智能手环设计与实现
  • [BJDCTF2020]The mystery of ip
  • RUST笔记:candle使用基础
  • Python算法题集_接雨水
  • FIND_IN_SET的使用:mysql表数据多角色、多用户查询
  • JVM篇----第十一篇