赞 | 5 |
VIP | 620 |
好人卡 | 38 |
积分 | 65 |
经验 | 125468 |
最后登录 | 2015-7-27 |
在线时间 | 1666 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 6545
- 在线时间
- 1666 小时
- 注册时间
- 2008-10-29
- 帖子
- 6710
|
这一段是默认脚本里战斗中播放动画的调用内容
- #--------------------------------------------------------------------------
- # ● 显示普通动画
- # targets : 对象的数组
- # animation_id : 动画 ID
- # mirror : 左右反转
- #--------------------------------------------------------------------------
- def show_normal_animation(targets, animation_id, mirror = false)
- animation = $data_animations[animation_id]
- if animation
- targets.each do |target|
- target.animation_id = animation_id
- target.animation_mirror = mirror
- abs_wait_short unless animation.to_screen?
- end
- abs_wait_short if animation.to_screen?
- end
- end
复制代码 里面的这2行就是在设置给谁播放动画
设置 动画ID
target.animation_id = animation_id
设置是否 左右反转播放该动画
target.animation_mirror = mirror
在事件脚本里用的时候
把 target 改成你需要的对象
把等号右边的改成 动画ID 和 是否反转 true 或 false
角色对象的语句是
$game_actors[角色ID]
$game_party.members[队伍中的位置.从0开始]
比如2号角色 $game_actors[2]
比如 队伍里第2位置的角色 $game_party.members[1]
要获取队伍里的角色前提必须是该位置必须要有角色 不然会在设置动画ID的时候报错
还有一个问题就是是否需要等待动画播放结束.
有这个需要的话可以再加一行
SceneManager.scene.wait_for_animation
- a = $game_party.members[0]
- a.animation_id = 101
- a.animation_mirror = true
- SceneManager.scene.wait_for_animation
复制代码 |
评分
-
查看全部评分
|