[請益] unity長按的設定
在之前詢問了Update()的細節後 自己有去改了一下
不過還是有一些問題
主要設定的程式是這樣子
void Update(){
for (int i = 0; i < NumStrings; ++i) {
ButtonsJustPressed [i] = false;
CheckKeyCode (StringKeys [i], i);
}
}
void CheckKeyCode( KeyCode code, int stringIndex ){
if( Input.GetKeyDown( code ) )
{
OnStringChange( stringIndex, true );
}
if( Input.GetKey( code ) && !ButtonsPressed[ stringIndex ] ){
OnStringChange( stringIndex, true );
}
if( Input.GetKeyUp( code ) ){
OnStringChange( stringIndex, false );
}
}
若是在物品落下時 利用長按的方法去接住 要怎麼改比較好?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 125.227.216.73
※ 文章網址: https://www.ptt.cc/bbs/GameDesign/M.1442984491.A.6CD.html
推
09/23 14:26, , 1F
09/23 14:26, 1F
→
09/23 14:26, , 2F
09/23 14:26, 2F
→
09/23 17:09, , 3F
09/23 17:09, 3F
→
09/23 23:34, , 4F
09/23 23:34, 4F
→
09/24 01:05, , 5F
09/24 01:05, 5F
→
09/24 01:07, , 6F
09/24 01:07, 6F
→
09/24 01:09, , 7F
09/24 01:09, 7F
→
09/24 01:10, , 8F
09/24 01:10, 8F
→
09/24 01:12, , 9F
09/24 01:12, 9F
→
09/24 01:14, , 10F
09/24 01:14, 10F
→
09/24 01:15, , 11F
09/24 01:15, 11F
→
09/24 01:16, , 12F
09/24 01:16, 12F
→
09/24 01:20, , 13F
09/24 01:20, 13F
→
09/24 01:20, , 14F
09/24 01:20, 14F
→
09/24 01:22, , 15F
09/24 01:22, 15F
→
09/24 01:22, , 16F
09/24 01:22, 16F
→
09/24 01:50, , 17F
09/24 01:50, 17F
→
09/24 01:51, , 18F
09/24 01:51, 18F

→
09/24 01:51, , 19F
09/24 01:51, 19F
→
09/24 01:52, , 20F
09/24 01:52, 20F
→
09/24 01:53, , 21F
09/24 01:53, 21F
→
09/24 01:54, , 22F
09/24 01:54, 22F
推
09/24 02:43, , 23F
09/24 02:43, 23F
GameDesign 近期熱門文章
PTT遊戲區 即時熱門文章
12
35