原创 使用Protobuf
導出命令 ./protoc --xx_out=path *.proto 導出CSharp注意 導出CSharp腳本時,需要在proto中加入package xxx防止包名重複,否則導出時會出現string subscript out of
原创 Lua語言的面向對象思想
1. 元表 metatable 首先了解一下元表 meta_table 當索引一個key時,普通表中沒有,就會到元表的__index中尋找。pairs訪問__index會報錯。 -- 定義一個普通的表 local normal_tab
原创 尋路算法之A Star
A*算法是最好優先算法的一種,是解決最短路徑的有效方法。只要理解A*的工作原理,算法就不難實現。 1. A* 的工作原理 什麼是尋路?尋路就是從有限的點中找出一條從起點到終點的路徑。但是,尋路的過程中我們不知道下一個節點是什麼,有
原创 [LeetCode]: Swap Nodes in Pairs方法介紹
Given a linked list, swap every two adjacent nodes and return its head. You may not modify the values in the list's nod
原创 MySQL修改密碼命令
方法1: 用SET PASSWORD命令 首先登錄MySQL。 格式:mysql> set password for 用戶名@localhost = password('新密碼'); 例子:mysql> set password
原创 [LeetCode] Contiguous Array
Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Inp
原创 [LeetCode] Backspace String Compare
Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspac
原创 防止Unity UGUI中UI點擊穿透問題
使用Input.MouseButton()方法時,通過 UI 的EventSystem判斷當前是否點擊了物體,這裏的物體是包含UI和物體的,PointEventData是把你當前所點擊到的物體數據進行一個獲取和保存,再獲取鼠標的位置信息,
原创 [LeetCode] ThreeSum
Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets
原创 解決Win10下無默認文件打開方式問題(cmd+regedit)
最近換了新電腦以後,將原來的項目移植到新pc上發現proto文件無法自動關聯vscode,但又不想開啓Win10自動更新,於是Google搜索了很多解決方案解決這個問題。以下是我的總結: 1. 使用Assoc命令關聯文件後綴和可執行程序
原创 Google 開源項目風格指南
Google 開源項目風格指南 (中文版)
原创 MySql免安裝版部署
1.解壓後在root路徑下創建my.ini並配置以下基本內容,@符號替換爲MySql解壓後的root路徑 [mysqld] character-set-server=utf8 skip-grant-tables basedir=@loc
原创 緩動函數
緩動函數
原创 [LeetCode]: Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head. You may not modify the values in the list's nod
原创 Unity 特效播放插件EffectPlayer
使用EffectPlayer可以快速實現點擊播放特效或在不同位置生成特效,減少代碼中大量的Input監聽代碼。 可以自己寫入EffectNames保存特效名稱,使用時參照以下模板。 PS:1.使用前將EffectPlayer放入Plugi