feat(skill): add force spawn position setting for skills
add forceStartX and forceStartY properties to control skill spawn position directly use world coordinates when the values are >=0, otherwise use original offset logic
This commit is contained in:
@@ -159,8 +159,17 @@ export class Skill extends ecs.Entity {
|
||||
SView.group = caster.box_group
|
||||
|
||||
this.add(SView);
|
||||
startPos.x = startPos.x + SView.atk_x * face
|
||||
startPos.y = startPos.y + SView.atk_y
|
||||
// 强制出生点:-1=不强制使用 atk_x/atk_y 偏移,>=0=强制世界坐标
|
||||
if (SView.forceStartX >= 0) {
|
||||
startPos.x = SView.forceStartX;
|
||||
} else {
|
||||
startPos.x = startPos.x + SView.atk_x * face;
|
||||
}
|
||||
if (SView.forceStartY >= 0) {
|
||||
startPos.y = SView.forceStartY;
|
||||
} else {
|
||||
startPos.y = startPos.y + SView.atk_y;
|
||||
}
|
||||
|
||||
node.setPosition(startPos);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user