利用插入排序法 根據顯示物件的Y座標來排序
/**
* 插入排序
* @param container 容器
* @param imin 排序起始
* @param imax 排序結尾
*/
function insertSort(container:DisplayObjectContainer,
imin:int,
imax:int):void {
for (var j:int= imin + 1 ; j < imax ;j++ )//從陣列第二個元素開始迴圈。
{
var key:DisplayObject = container.getChildAt(j);
var t:int = j;
while (t > 0 && container.getChildAt(t-1).y > key.y)
{
t--;
}
if (t != j) {
container.setChildIndex(key, t);
}
}
}
2014-01-18
訂閱:
張貼留言 (Atom)
[Unity] Odin Inspector DateTime 時間屬性繪製
Odin Inspector 是一個有名的Unity Inspector Plugin,但沒有為 DateTime 建立可編輯的可視化介面,這邊簡單提供一個可用的方法 。 Odin Inspector 版本 : 3.3.1.14
-
IP Messenger 4.99r3 繁體中文版 介紹:方便區網內傳輸的小工具,又名飛鴿傳書。 支援文字、圖片、檔案、資料夾點對點傳輸。
-
使用環境 : Visual Studio Community 2019 錯誤訊息 : 錯誤 NETSDK1004 找不到資產檔案 '...\obj\project.assets.json'。請執行 NuGet 套件還原,以產生此檔案。
-
在 Cocos Creator 中配置定製版引擎與模擬器 Custom Engine - Use Custom Cocos2d-x Engine 建立環境 作業系統: Windows 10 Pro Cocos Creator版本:2.3.0 因為此Cocos版本...
沒有留言:
張貼留言