加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
#==============================================================================
# ■ VariableProxy
#==============================================================================
module VariableProxy
def self .variable_proxy sym, var
( class << self ; self ; end ) .instance_eval {
define_method sym do
$game_variables [ var]
end
define_method :"#{sym.to_s}=" do |v|
$game_variables [ var] = v
end
}
end
variable_proxy :proxy1 , 1
variable_proxy :proxy2 , 2
variable_proxy :proxy3 , 3
end
module VariableProxy
def self .variable_proxy sym, var
( class << self ; self ; end ) .instance_eval {
define_method sym do
$game_variables [ var]
end
define_method :"#{sym.to_s}=" do |v|
$game_variables [ var] = v
end
}
end
variable_proxy :proxy1 , 1
variable_proxy :proxy2 , 2
variable_proxy :proxy3 , 3
end
#==============================================================================
# ■ SwitchProxy
#==============================================================================
module SwitchProxy
def self .switch_proxy sym, var
( class << self ; self ; end ) .instance_eval {
define_method sym do
$game_switches [ var]
end
define_method :"#{sym.to_s}=" do |v|
$game_switches [ var] = v
end
}
end
switch_proxy :proxy1 , 1
switch_proxy :proxy2 , 2
switch_proxy :proxy3 , 3
end
module SwitchProxy
def self .switch_proxy sym, var
( class << self ; self ; end ) .instance_eval {
define_method sym do
$game_switches [ var]
end
define_method :"#{sym.to_s}=" do |v|
$game_switches [ var] = v
end
}
end
switch_proxy :proxy1 , 1
switch_proxy :proxy2 , 2
switch_proxy :proxy3 , 3
end
意义不明的东西。
VariableProxy.proxy1 代理操作1号变量……
举个例子而已 proxy1 是代码里定义的 = =b