xggzga117 发表于 2014-3-9 14:27
嗯成功了!把相关脚本发上来……
#------------------------------------------------------------------ ...
def update contents.clear if $game_switches[2] == true refresh if $game_switches[2] == true end
def update if $game_switches[2] == true contents.clear refresh end end
其一 | 其二 |
因为整个update方法只有一个判定:如果满足 执行 不满足 什么也不做 我们可以让这个更直观 如果不满足 什么也不做 | 这算是比较取巧的做法 不推荐使用 但值得了解 本质是构建数组时进行的求值 |
RUBY 代码复制
| RUBY 代码复制
|
def update draw_shit1 if $game_switches[2] end def refresh contents.clear draw_shit1 end # def contents.clear省略
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |