上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 47 下一页
摘要: 就是将颜色值通过映射公式得到另一种颜色值,比如:将颜色值*0.8也算是映射公式 但这边介绍的映射公式可以得到一种电影校色的效果,至于原理,一般都是经验公式。 效果 c#代码 using UnityEngine; public class TonemappingEff : MonoBehaviour 阅读全文
posted @ 2024-03-27 22:49 yanghui01 阅读(50) 评论(0) 推荐(0)
摘要: 效果 c#代码 using UnityEngine; public class MyBrightnessSaturationAndContrast : MonoBehaviour { public Shader m_Shader; public Material m_Material; [Range 阅读全文
posted @ 2024-03-27 22:32 yanghui01 阅读(25) 评论(0) 推荐(0)
摘要: lua下常用的2个protobuf库 1) GitHub - starwing/lua-protobuf: A Lua module to work with Google protobuf 2) GitHub - cloudwu/pbc: A protocol buffers library fo 阅读全文
posted @ 2024-03-07 22:28 yanghui01 阅读(539) 评论(2) 推荐(0)
摘要: xlua貌似不支持单独动态加载cjson.dll,试了各种方式,都是会造成Unity闪退,也不知道原因。 解决办法就是直接编译进xlua.dll 1) 下载lua-cjson源码,并解压到xlua的build文件夹根目录 GitHub - openresty/lua-cjson: Lua CJSON 阅读全文
posted @ 2024-03-03 22:28 yanghui01 阅读(573) 评论(0) 推荐(0)
摘要: 注意:只在lua 5.1才支持,后面的lua版本做了改动不再兼容 myEnv.lua local myEnv = {} myEnv.a = 1 myEnv.b = "one" myEnv.log = print return myEnv Test.lua local myEnv= require(" 阅读全文
posted @ 2024-03-03 22:03 yanghui01 阅读(58) 评论(0) 推荐(0)
摘要: 项目的所有文件 CMakeLists.txt cmake_minimum_required(VERSION 3.12.0) set(Proj_Name "MyLuaLib") project(${Proj_Name}) message(" PROJECT_BINARY_DIR: ${PROJECT_ 阅读全文
posted @ 2024-03-02 21:58 yanghui01 阅读(197) 评论(0) 推荐(0)
摘要: 像ugui的点击按钮,然后触发相关逻辑,都是回调模式的写法,比如下面代码的ShowAlert调用 public class Test7 : MonoBehaviour { public GameObject m_Alert; public Text m_TxtMsg; public Button m 阅读全文
posted @ 2024-02-29 23:17 yanghui01 阅读(54) 评论(0) 推荐(0)
摘要: c# 部分 public class Test5Obj { public int i; private string str; public Test5Obj() { } public void PrintInt() { Debug.Log($"c# PrintInt:{i}"); } public 阅读全文
posted @ 2024-02-29 23:04 yanghui01 阅读(98) 评论(0) 推荐(0)
摘要: lua实现IEnumerator接口:Assets/Lua/LuaEnumeratorImpl.lua.txt local Move_End_Flag = {} local LuaEnumeratorImpl = {} LuaEnumeratorImpl.__index = LuaEnumerato 阅读全文
posted @ 2024-02-28 22:51 yanghui01 阅读(154) 评论(0) 推荐(0)
摘要: 协程是单线程运行的,它只是提供了一种代码在当前位置暂停,后续还能在当前位置恢复继续执行下去的机制。 1, 启动协程, 以及yield local co1Func = function(str1, str2) for i=1,2 do print(" ", i, str1, str2) local s 阅读全文
posted @ 2024-02-28 22:45 yanghui01 阅读(78) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 47 下一页