Project1
标题:
关于变量控制的~
[打印本页]
作者:
neverstop
时间:
2014-8-21 18:16
标题:
关于变量控制的~
就是想在打开菜单是变量2会 = 7,而关闭菜单时,变量2 会=2
就是这样。
作者:
喵呜喵5
时间:
2014-8-21 18:20
本帖最后由 喵呜喵5 于 2014-8-21 20:08 编辑
class Scene_Menu
alias m5_20140821_start start
def start
$game_variables[2] = 7
m5_20140821_start
end
alias m5_20140821_return_scene return_scene
def return_scene
$game_variables[2] = 2
m5_20140821_return_scene
end
end
复制代码
作者:
喵呜喵5
时间:
2014-8-21 19:52
测试过了,即使是原来的脚本我这边变量的值也是正常的啊
我稍微修改了二楼的代码,再试试吧,如果不行的话试试下面这段代码
class Game_Variables
alias m5_20140821_get []
def [](variable_id)
if variable_id == 2
return SceneManager.scene.is_a?(Scene_MenuBase)? 7 : 2
else
return m5_20140821_get(variable_id)
end
end
end
复制代码
如果还是不行的话,我觉得是你使用的脚本的问题,请附上你使用的那个脚本
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1