public override NodeResult Execute() { AITargeter aiSource = source as AITargeter; AITargeter s = Spawner.GetSpawnerOfSource(source as AITargeter); if (s) { axis = s.transform.forward; } else { Debug.LogError("Missing spawner source."); return(NodeResult.Failure); } (source as AITargeter).moving.Attach(mode, CircleMotion.GenerateCircleOfDirections(aiSource.transform.position, s.transform.position, size, pointsDetail, axis)); return(NodeResult.Success); }
public override NodeResult Execute() { KeyCheck(); AITargeter s = source as AITargeter; float t = times[s]; if (Time.time > t) { Vector3[] pts = CircleMotion.GenerateCircleOfDirections(1, this.pts); for (int i = 0; i < this.pts; i++) { Transform b = Instantiate((Transform)bullet.GetValue(), s.transform.position, new Quaternion()); b.up = pts[i]; } t = Time.time + (float)rate.GetValue(); } times[source as AITargeter] = t; return(NodeResult.Success); }