public void Add(ForceElement fe) { if (listf == null) { listf = new List <ForceElement>(); } listf.Add(fe); }
public static void BackForce(GameObject game, Vector2 Direction, float force, float time) { ForceElement fe = new ForceElement(Direction, time, force); if (game.TryGetComponent(out Force f)) { f.Add(fe); } else { game.AddComponent <Force>().Add(fe); } }