原创 Unity AudioClip 音頻數據轉 byte[] 格式輸出

 public byte[] AudioClipToByte(AudioClip clip)     {         float[] data = new float[clip.samples];         clip.GetDa

原创 Unity 2D 物體旋轉指向目標

  Vector2 direction = target.transform.position - transform.position;   float angle = Mathf.Atan2(direction.y, directio

原创 從零開始讀算法導論第三版 求最大子數組和 LUA實現

A = {13, -3, -25, 20, -3, -16, -23, 18, 20, -7, 12, -5, -22, 15, -4, 7} function find_max_crossing_subappay(A, low, mi

原创 JSON 與 LUA Table 相互轉換

注: 本代碼並非我原創,我只是在原有基礎上進行修改 先貼代碼 原本的代碼是從網上隨便找的,但是在實際用了之後發現兩點問題: 1.不支持 lua  table = {[1] = 1,['a'] = "hey"} 的寫法    2.lua

原创 一個拉選框的製作

我做了一個區塊欄 但是當前的功能只能選中一個格子  他看起來就是這樣的    但是功能很薄弱只能選擇一個區域(32x32) 如果我想複製這個 4 x 5 的樹 那麼我就要點20次 所以我做了一個可以讓鼠標產生一個拉框的功能 

原创 Unity 5.x&Android SDK接入 Unable to convert classes into dex format.錯誤的解決

Unity 5.x  導入jar包時,把gen下面的 R包的勾去掉就可以了

原创 從零開始讀算法導論第三版 歸併排序 LUA實現

function merge(A, p, q, r) local n1 = q - p + 1 local n2 = r - q local L = {} local R = {} for i =

原创 Unity3d 打包未響應 CPU100% 解決方案

檢查一下Graphic下是否添加了   Standard  這個shader 移除 重新打包

原创 Unity3D Android Encoding.GetEncoding("gb2312") 中文轉碼無響應

Unity打包之後 手機上運行 發現運行到轉碼部分就沒反應了 百度搜索 I18N.dll I18N.CJK.dll 下載到Assets下 重新打包

原创 Unity3D 第一人稱視角攝像機旋轉控制

//方向靈敏度 public float sensitivityX = 10.0f; public float sensitivityY = 10.0f; //上下最大視角(Y視角) public flo

原创 LUA 棧實現

function STACK_EMPTY(S) if S.top == 0 then return true end return false end function PUSH(S,x) S.top = S.top + 1

原创 學習 unity過程中的一些筆記和發現(1)

4.3之前的unity   不允許中文路徑,包括導入的包  已經unity本身安裝的路徑 4.4之後開始支持中文 RenderSetting 渲染設置 在unity5.0之後 移動到了  windows → lighting 中 Syk

原创 C#特性的分類

首先什麼是特性? 大家平時都會在編程的時候使用註釋 //   /* */    //// 如果說  //註釋是給程序員用的 那麼特性就是專門給計算機看的註釋,一般寫在命名空間上方,對象名上方,方法名,類名的上方 C#特性有很多  不過大