|
|
|
@ -14,12 +14,15 @@ func init(id:int,cfg:CharacterCfg,team:Enum.ETeam):
|
|
|
|
status.team = team
|
|
|
|
status.team = team
|
|
|
|
status.cfg = cfg
|
|
|
|
status.cfg = cfg
|
|
|
|
var half_height = Setting.pixel_size * cfg.sprite_harf_height
|
|
|
|
var half_height = Setting.pixel_size * cfg.sprite_harf_height
|
|
|
|
|
|
|
|
var height = half_height * 2
|
|
|
|
var width = Setting.pixel_size * cfg.sprite_width
|
|
|
|
var width = Setting.pixel_size * cfg.sprite_width
|
|
|
|
var body_scale = Vector3(width,half_height*2,width)
|
|
|
|
var body_scale = Vector3(width,height,width)
|
|
|
|
collision.position = Vector3(0,half_height,0)
|
|
|
|
collision.position = Vector3(0,half_height,0)
|
|
|
|
collision.scale = body_scale
|
|
|
|
collision.scale = body_scale
|
|
|
|
status.basic_offset = Vector3(0,half_height,0)
|
|
|
|
status.basic_offset = Vector3(0,half_height,0)
|
|
|
|
status.ui_offset = Vector3(0,half_height*2.2,0)
|
|
|
|
status.ui_offset = Vector3(0,height*1.1,0)
|
|
|
|
|
|
|
|
status.radius = width
|
|
|
|
|
|
|
|
status.height = height
|
|
|
|
view.init(cfg.sprite_frames)
|
|
|
|
view.init(cfg.sprite_frames)
|
|
|
|
skill.init()
|
|
|
|
skill.init()
|
|
|
|
effect.init(cfg.type,body_scale)
|
|
|
|
effect.init(cfg.type,body_scale)
|
|
|
|
@ -64,6 +67,8 @@ func cfg()->CharacterCfg:return status.cfg
|
|
|
|
func team()->Enum.ETeam:return status.team
|
|
|
|
func team()->Enum.ETeam:return status.team
|
|
|
|
func pos2D()->Vector2:return Vector2(position.x,position.z)
|
|
|
|
func pos2D()->Vector2:return Vector2(position.x,position.z)
|
|
|
|
func pos()->Vector3:return position
|
|
|
|
func pos()->Vector3:return position
|
|
|
|
|
|
|
|
func radius()->float:return status.radius
|
|
|
|
|
|
|
|
func height()->float:return status.height
|
|
|
|
func view_pos()->Vector3:return position + view.position
|
|
|
|
func view_pos()->Vector3:return position + view.position
|
|
|
|
func ui_pos()->Vector3:return position + status.ui_offset
|
|
|
|
func ui_pos()->Vector3:return position + status.ui_offset
|
|
|
|
|
|
|
|
|
|
|
|
|