RGSS 脚本参考

RGSS 脚本中的 @ 是什么?

RGSS中脚本的@语法说明

定义一个类的实例变量。 为了能够读取和写入这种类型的变量,您还需要为它们创建访问器方法。 您还可以使用 attr_reader、attr_writer 或 attr_accessor 短代码自动加载相关运算符。

代码示例:

def initialize
  @battler_name = ""
  @battler_hue = 0
  @hp = 0
  @sp = 0
  @states = []
  @states_turn = {}
  @maxhp_plus = 0
  @maxsp_plus = 0
  @str_plus = 0
  @dex_plus = 0
  @agi_plus = 0
  @int_plus = 0
  @hidden = false
  @immortal = false
  @damage_pop = false
  @damage = nil
  @critical = false
  @animation_id = 0
  @animation_hit = false
  @white_flush = false
  @blink = false
  @current_action = Game_BattleAction.new
end

发表回覆

您的电子邮件地址将不会被发表。 必填字段标有 *

本网站使用Akismet来减少垃圾邮件。 了解您的评论数据是如何处理的.