TS
年少轻狂s
本博客以下为个人笔记,如若有误,欢迎赐教。
菜鸟之路,坎坷难行......
展开
-
在cocos creator TS 中如何使用protobuf(自动化,评论中有)
// account.protopackage protoTest;//角色对象message Player{ optional int64 id = 1; optional string name = 2; optional int32 level = 3;//等级}npm install protobufjs -g // 全局安装,注:项目中安装也可以,在执行下面命令的时候,指明相对路径// 并将安装后的目录下的dist/protobuf.js拖到cocos cr原创 2021-02-20 10:47:45 · 1716 阅读 · 9 评论 -
MVVM模式,数据驱动ui
观察者模式下的数据驱动ui显示:修改data数据后,会在观察者响应的回调中传入old,new两个数值进行ui修改,目前包括,数值相同监听(alwaysWatch),数值发生变化监听(watch),支持监听 number boolean string array JsonData等五种格式(不包含对象)// Observer.ts/** * time: 2021/1/25 * func: 观察者对象 */export default class Observer{ /** 监控的原创 2021-01-26 19:29:39 · 331 阅读 · 1 评论 -
A*搜索算法分享
/** * author: xa * time: 2019/4/23 * func: A*搜索算法 */interface List{ x: number, // 当前X轴坐标 y: number, // 当前Y轴坐标 weight?: number, // 当前搜索路径权重 len?: number, //...原创 2019-04-24 21:13:47 · 162 阅读 · 0 评论