Toggle navigation
Search
思元的開發筆記
Programming
Unity
LeetCode
Golang
Game Demos
Archive
Blog
About
思元的開發筆記
關於 web service, unity, blogger 等軟體工程筆記
×
Search dev.twsiyuan.com
C# coding style 檢查工具 - StyleCop
Coding style,程式寫作風格,每個人寫作風格都有所不同,例如變數命名大小寫,函數大括號需不需換行,使用 space 還是 tab 來縮排等等。 在多人的大專案中,會期望成員們使用相同的寫作風格,以讓其他成員們容易互相支援,維護程式碼。 但怎麼確認有按照規定的...
Read More
王思元
12:22 下午
軟體開發
,
C-sharp
QR code generator in Unity
需求要在遊戲中顯示 QR code,該 QR code 帶某網站的網址,原先是計畫用工具生成 QR code 後,放入 Unity 當作貼圖使用。 但考慮到這網址可以從遊戲伺服器資料拿到,那為何不用動態產生 QRCode,省去未來網址修改,替換貼圖的麻煩呢?紀錄實作此功能...
Read More
王思元
6:29 下午
程式語言
,
C-sharp
,
Unity
Implement web-request cache in Unity
工作上需求,在遊戲開始前總是會根據伺服器資料,透過 HTTP 下載指定圖片並顯示在遊戲中,這些圖檔下載若沒有 Cache (快取,緩存),長時間下來流量也是相當可觀,因此怎麼建立圖片快取,這篇紀錄思考流程以及最後的解解決方案,並提供程式碼。 注意: Unity 5.5.x...
Read More
王思元
10:46 下午
程式語言
,
C-sharp
,
Unity
Animation & Easing functions in Unity (Tween)
從 GamJam 活動 得到的啟發,紀錄在 Unity 常用的程式製作插值 (Lerp) 動畫的技巧,例如控制方塊在三秒內,由紅色轉換成藍色,不用 Animator 建立 Animation Clip,而是用程式實現。 完成這項任務,通常需要這三個 Input ...
Read More
王思元
7:45 下午
程式語言
,
C-sharp
,
Unity
Loading inform pattern
記錄在 Unity 中,實作載入任務的 patterns。在任務開始前開啟工作提示 (like activity inform 或是載入進度條),結束後關閉工作提示 。工作提示可以是開啟顯示進度條,或是其他任何可以提示使用者的顯示物件,在這次範例使用手持平台用的 Acti...
Read More
王思元
11:22 下午
程式語言
,
C-sharp
,
Unity
State vs Coroutine in Unity
GameJam 中看到組員的程式碼,有感寫下這篇記錄,提供另一種撰寫主流程狀態機的方式。使用 Unity5.5.0f1 版本測試。 自動販賣機範例 考慮一個簡單自動販賣機的流程,一開始停留在待機狀態,如果使用者 投入硬幣時,則進入到投幣狀態。 等待使用者投入足夠的金額...
Read More
王思元
11:44 下午
程式語言
,
C-sharp
,
Unity
較新的文章
較舊的文章
粉絲專頁
本週熱門
網誌存檔
贊助廣告
粉絲專頁
每周熱門
C++ Library callback using C# in Unity and cross thread call
由社團文章討論所做的測試,主要是有人詢問,在外部 C++ library callback 函數中,呼叫 StartCoroutine 而導致錯誤訊息 StartCoroutine can only be called from the main thread。這明顯是一個跨執...
Unity Platformer 2D: Character Movement using Physical
物理與碰撞 想要在 Unity 中使用其物理引擎控制 2D 遊戲物件,Rigidbody2D,這一個組件(Component)是最重要的核心。把 Rigidbody2D 加上 2D 碰撞體(2D Colliders)放在同一個 GameObject 上,即可在遊戲中看到自由落...
C# Array operations in Unity
Array 整理一下 C# Array(陣列)的筆記,紀錄對陣列常用的操作。 結論:若需要使用程式對 Array 進行大量的資料操作,請改用 List。 範例都以以下程式碼為基礎,在 Start 撰寫以下的展示程式碼。請注意引用到 UnityEditor,請留意發佈的編譯...
Unity 專案中 *.meta 做什麼用
最近團隊有人詢問 Unity 的 GUID 機制,在思考回答的過程中,順便把它整理成這篇筆記。如果要尋找能夠與工程團隊合作的 Unity 工程師,我想這一題應該會列在考題之中,meta 檔是做什麼用的?如果能回答出 Unity GUID 追蹤資源的機制,相信已經能夠滿足團隊...
Unity Coroutine 使用筆記
最近有人問為什麼 Nested coroutine 的機制與問題,為什麼會是需要 yield return StartCoroutine(...) ,而不能省略 StartCoroutine ?在久遠的 Unity3.x 時代,印象中得呼叫該函數才能夠正常運作。...
Unity Platformer 2D: Character Animations
延續上一篇 Character 2D Movement using Physical in Unity 的練習,繼續使用 FGJ 活動中,團隊所繪製的素材繼續練習。這次要結合之前的角色移動以及跳躍功能,加上播放對應的動畫。 Prepare Animation Clips...
Unity5 Graphic raycastTarget default values
What is this 從社團上看到有人在討論,Unity GUI 大量的 UI 物件會使得 Graphic Raycaster 效能低落,因為要判斷該 Canvas 上許多的 Graphic 物件有沒有被 Ray 打到。主要的解決方案是減少判斷的 Graphic 物件,設...
There are inconsistent line endings in the 'SomeScript.cs' script. Some are Mac OS X (UNIX) and some are Windows. 的處理方法
Unity 使用上常常遇到的警告,經常從 Unity Project 點選程式碼,使用預設的 IDE - Visual Studio 編輯程式碼後,回到 Unity 等待編譯完成後,會遇到丟出來的警告訊息:
Unity5 Editor ReorderableList
ReorderableList 整理使用 Unity ReorderableList 筆記,希望以後有範本可以直接複製貼上,不用每次都要重新找文章,依樣畫葫蘆重做一次。 // Path: /Scripts/ShopMenu.cs using UnityEngine; ...
學習 Unity 自製編輯器需要知道的三個管道 (Custom editor programming in Unity)
Unity 現在算是台灣業界常用的遊戲引擎之一,其功能不僅協助開發人員快速開發遊戲外,還提供讓開發人員自訂專案所需要的編輯器 (Editor)。 一位資深的程式設計師不僅得學習如何使用 Unity,撰寫架在 Unity 上的專案程式碼,甚至還需要學習如何開發 Unity ...
網誌存檔
►
2018
( 27 )
►
10月
( 1 )
►
9月
( 1 )
►
8月
( 1 )
►
6月
( 3 )
►
5月
( 5 )
►
4月
( 4 )
►
3月
( 1 )
►
2月
( 6 )
►
1月
( 5 )
▼
2017
( 59 )
►
12月
( 4 )
►
11月
( 3 )
►
10月
( 6 )
►
9月
( 5 )
►
8月
( 5 )
►
7月
( 5 )
►
6月
( 5 )
►
5月
( 4 )
►
4月
( 5 )
►
3月
( 8 )
▼
2月
( 6 )
C# coding style 檢查工具 - StyleCop
QR code generator in Unity
Implement web-request cache in Unity
Animation & Easing functions in Unity (Tween)
Loading inform pattern
State vs Coroutine in Unity
►
1月
( 3 )
►
2016
( 44 )
►
12月
( 3 )
►
11月
( 2 )
►
10月
( 6 )
►
9月
( 4 )
►
8月
( 5 )
►
7月
( 4 )
►
6月
( 4 )
►
5月
( 2 )
►
4月
( 2 )
►
3月
( 3 )
►
2月
( 6 )
►
1月
( 3 )
►
2015
( 1 )
►
12月
( 1 )
贊助廣告