This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--updateAllを併用したい場合はrequireの前に書く必要がある | |
function updateAll() | |
--timeout.luaの中で実行される | |
end | |
--setTimeout,setInterval,clearIntervalを使えるようにする | |
require 'timeout'._(_ENV) | |
--setTimeoutの使い方 | |
setTimeout (function() | |
print("10秒後に1度だけ実行") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--notをつけるとtrueとfalseが入れ代わるので、 | |
--呼び出すごとにオンとオフを切り替えるスイッチを作れる | |
function onUse() | |
isOnOffSwitch = not isOnOffSwitch; | |
if isOnOffSwitch then | |
print"オン" | |
else | |
print "オフ" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- こちらはオーディオクリップだけに対応したコードです | |
-- ループ時間 | |
OneLoop = 180 | |
loopTime = OneLoop * 2 --2周分 | |
-- オーディオクリップの再生タイミングの設定 | |
-- audioPlayTiming[(秒数)] = "(オーディオクリップ名)" | |
audioPlayTiming = {} | |
audioPlayTiming[0] = "audio3" --次の駅まであと |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Anime = 0 -- 次に再生中されるアニメクリップ(UnityでElement ~に入ってるアニメ)番号が入る変数 | |
---[SubItemの所有権]アイテムをグラッブしてグリップボタンを押す度にアニメを変更する | |
function onGrab(target) | |
print("Play Anime id : "..Anime) | |
vci.assets._ALL_PlayAnimationFromIndex(Anime,true) -- Animeにセットされた番号のアニメクリップが再生される | |
Anime = Anime + 1 -- 次に再生されるアニメクリップ番号 | |
if (Anime == 3) then Anime = 0 end -- 再生アニメが3になったら0に戻す | |
end |