/// <summary> /// Update dynamic potential field /// </summary> public void Update() { if (Time.timeScale > 0) { dynamicPF.Clear(0); foreach (IForceGenerator gen in dynamicGenerators) { gen.GenerateForce(ref dynamicPF); } UpdateResultPF(); } }
/// <summary> /// Update semi-static potential field /// </summary> public void UpdateSemistaticPF() { semistaticPF.Clear(0); for (int i = semistaticGenerators.Count - 1; i >= 0; i--) { IForceGenerator gen = semistaticGenerators[i]; if (gen != null) { gen.GenerateForce(ref semistaticPF); } else { semistaticGenerators.RemoveAt(i); } } }