public override void InitPos(ref Vector2d startPos, ref Vector2d startDir) { // 修正起始位置XZ Vector3 deltaPos = m_triggerData.vBulletDeltaPos; Vector2d vL = FPCollide.Rotate(startDir.normalized, 90) * new FixedPoint(deltaPos.x); // 左右偏移 Vector2d vF = startDir.normalized * new FixedPoint(deltaPos.z); // 前后偏移 startPos = m_caster.GetPos() + vL + vF; }
public override void InitPos(ref Vector2d startPos, ref Vector2d startDir) { // 如果技能位置是0,则起点为施法者位置 if (m_skillPos == Vector2d.zero) { m_skillPos = startPos; } // 有距离时,表示为终点位置的偏移 Vector2d dir = FPCollide.Rotate(startDir, m_triggerData.dirDelta); startDir = dir; startPos = m_skillPos + dir.normalized * m_triggerData.disDelta; }
public override void InitPos(ref Vector2d startPos, ref Vector2d startDir) { // 修正起始位置startPos startPos = startPos + startDir.normalized * new FixedPoint(m_triggerData.vBulletDeltaPos.z); // 修正结束位置 Vector2d dir = FPCollide.Rotate(startDir, m_triggerData.dirDelta); m_skillPos = m_skillPos + dir.normalized * m_triggerData.disDelta; // 一定时间后设置逻辑位置 CFrameTimeMgr.Inst.RegisterEvent(m_triggerData.ContinuanceTime - 100, () => { SetPos(m_skillPos, true); }); }
public Vector2d[] GetVert2d() { // 先求矩形坐标系中四个点位置 Vector2d v1 = new Vector2d(-e.x, e.y); Vector2d v2 = new Vector2d(e.x, e.y); Vector2d v3 = new Vector2d(e.x, -e.y); Vector2d v4 = new Vector2d(-e.x, -e.y); v1 = center + FPCollide.Rotate(v1, ang); v2 = center + FPCollide.Rotate(v2, ang); v3 = center + FPCollide.Rotate(v3, ang); v4 = center + FPCollide.Rotate(v4, ang); Vector2d[] list = new Vector2d[4]; list[0] = v1; list[1] = v2; list[2] = v3; list[3] = v4; return(list); }
public override void InitPos(ref Vector2d startPos, ref Vector2d startDir) { // 修正起始位置XZ Vector3 deltaPos = m_triggerData.vBulletDeltaPos; float randomDir = m_triggerData.iCurveHeight; Vector2d vL = FPCollide.Rotate(startDir.normalized, 90) * new FixedPoint(deltaPos.x); // 左右偏移 Vector2d vF = startDir.normalized * new FixedPoint(deltaPos.z); // 前后偏移 startPos = m_caster.GetPos() + vL + vF; // 随机方向 //if (randomDir != 0) //{ // int dirDelta = (int)randomDir; // float random = GameManager.Inst.GetRand(-dirDelta, dirDelta + 1, 0); // startDir = FPCollide.Rotate(startDir.normalized, (int)random); //} // 修正起始方向 if (m_triggerData.dirDelta != 0) { startDir = FPCollide.Rotate(startDir, m_triggerData.dirDelta); } }