// Update is called once per frame void Update() { var em = World.DefaultGameObjectInjectionWorld.EntityManager; if (crowds.Length > 0) { var mInfected = 0; var mImmune = 0; foreach (var crowd in crowds) { var(infected, immune) = crowd.GetEntities(em); mInfected += infected; mImmune += immune; } diagram.AddPoint(infectedId, mInfected); diagram.AddPoint(immuneId, mImmune); return; } }
private void Update() { if (diagram == null) { return; } for (int i = 0; i < crowdSpawners.Count; i++) { var crowd = crowdSpawners[i]; if (crowd.HasEnties()) { diagram.AddPoint(ids[i], crowd.EntitiesDistanceFromGoal()); } } }