/** 获取技能目标数据位置 */ public void getSkillTargetDirection(DirData re, PosData pos, SkillTargetData tData) { if (tData.type == SkillTargetType.None || tData.type == SkillTargetType.AttackScope) { Unit unit = _scene.getFightUnit(tData.targetInstanceID); if (unit != null) { re.copyDir(unit.pos.getDir()); } else { re.clear(); } return; } if (tData.targetInstanceID != -1) { Unit unit = _scene.getFightUnit(tData.targetInstanceID); if (unit != null) { _scene.pos.calculateDirByPos(re, pos, unit.pos.getPos()); } else { re.clear(); } } else { PosData pp = tData.pos; if (pp != null) { _scene.pos.calculateDirByPos(re, pos, pp); } else { if (tData.dir == null) { re.clear(); } else { re.copyDir(tData.dir); } } } }
/// <summary> /// 回归0 /// </summary> public override void clear() { pos.clear(); dir.clear(); }