private JSingleLineTrajectory[] SingleLineFacyory(JTrajectoryClipData clip) { if (clip.skillunit.launchType != JSkillUnit.LaunchType.SINGLELINE) { return(null); } List <JSingleLineTrajectory> list = new List <JSingleLineTrajectory>(); SkillLine line = (SkillLine)clip.skillunit.skillObj; if (line.waves == 0) { line.waves = 1; } for (int i = 0; i < line.waves; i++) { JSingleLineTrajectory sg = new JSingleLineTrajectory(); sg.TargetObject = clip.TargetObject; sg.skillunit = clip.skillunit; sg.effectunit = clip.effectunit; sg._originDir = clip.TargetObject.transform.forward; sg._delayBegin = i * line.waveDelay; list.Add(sg); } if (clip.skillunit.guidePolicy != null) { clip.PlaybackDuration = (line.waveDelay * line.waves + line.moveTime + clip.skillunit.guidePolicy.guideTime + clip.skillunit.guidePolicy.guidingTime) / 1000f; } else { clip.PlaybackDuration = (line.waveDelay * line.waves + line.moveTime) / 1000f; } return(list.ToArray()); }
public override void OnMoveUpdate(float time) { if (effecrObj != null) { foreach (var p in particleSys) { p.Simulate(time, true); } Vector3 dir = _originDir; if (skillunit.launchType == JSkillUnit.LaunchType.SINGLELINE) { SkillLine line = (SkillLine)skillunit.skillObj; float fen = time / (line.moveTime / 1000f); Vector3 final = _originPos + dir * line.speed * line.moveTime / 1000f; effecrObj[0].transform.position = Vector3.Lerp(_originPos, final, fen); } if (skillunit.launchType == JSkillUnit.LaunchType.MULLINE) { SkillMultiLine line = (SkillMultiLine)skillunit.skillObj; float fen = time / (line.moveTime / 1000f); Vector3 final = _originPos + dir * line.speed * line.moveTime / 1000f; effecrObj[0].transform.position = Vector3.Lerp(_originPos, final, fen); effecrObj[0].transform.forward = _originDir; } } }
public SkillLine Copy() { SkillLine b = new SkillLine(); b.id = id; b.moveTime = moveTime; b.speed = speed; b.waves = waves; b.waveDelay = waveDelay; b.maxInfluence = maxInfluence; b.canPierce = canPierce; b.hitArea = hitArea.Copy(); b.offset = offset; return(b); }
//绘制弹道技能 public static void DrawSkillSingleLine(SkillLine line) { EditorGUILayout.BeginVertical("Box"); line.id = EditorGUILayout.IntField(" id", line.id); line.moveTime = EditorGUILayout.IntField(" moveTime", line.moveTime); line.speed = EditorGUILayout.FloatField(" speed:", line.speed); line.waves = EditorGUILayout.IntField(" waves:", line.waves); line.waveDelay = EditorGUILayout.IntField(" waveDelay:", line.waveDelay); line.maxInfluence = EditorGUILayout.IntField(" maxInfluence:", line.maxInfluence); line.canPierce = EditorGUILayout.Toggle(" canPierce:", line.canPierce); line.offset = EditorGUILayout.Vector3Field(" offset:", line.offset); SkillShape hitarea = line.hitArea; DrawSkillShape(" hitArea:", hitarea); EditorGUILayout.EndVertical(); }
public static SkillLine ConvertSkillLine(SkillUnit.SkillLine unit) { SkillLine oUnit = new SkillLine(); oUnit.id = unit.id; oUnit.moveTime = unit.moveTime; oUnit.canPierce = unit.canPierce; oUnit.offset = Vector3.zero; if (unit.offset != null) { oUnit.offset = new Vector3(unit.offset.x, unit.offset.y, unit.offset.z); } oUnit.speed = unit.speed; oUnit.waves = unit.waves; oUnit.waveDelay = unit.waveDelay; oUnit.maxInfluence = unit.maxInfluence; oUnit.hitArea = ConvertSkillShape(unit.hitArea); return(oUnit); }
public static SkillUnit.SkillLine ConvertSkillLine(SkillLine unit) { SkillUnit.SkillLine oUnit = new SkillUnit.SkillLine(); oUnit.id = unit.id; oUnit.moveTime = unit.moveTime; oUnit.canPierce = unit.canPierce; oUnit.offset = new Math.Vector3f(); oUnit.offset.x = unit.offset.x; oUnit.offset.y = unit.offset.y; oUnit.offset.z = unit.offset.z; oUnit.speed = unit.speed; oUnit.waves = unit.waves; oUnit.waveDelay = unit.waveDelay; oUnit.maxInfluence = unit.maxInfluence; oUnit.hitArea = ConvertSkillShape(unit.hitArea); return(oUnit); }