protected override void OnUpdate() { var source = group.GetComponentDataArray <SpawnData>(); for (int i = 0; i < source.Length; i++) { SpawnData spawn = source[i]; spawn.CountDown -= UnityEngine.Time.deltaTime; source[i] = spawn; } }
protected override void OnUpdate() { var source = group.GetComponentDataArray <SpawnData>(); for (int i = 0; i < source.Length; i++) { if (source[i].CountDown <= 0f) { SpawnData spawn = source[i]; spawn.CountDown += UnityEngine.Random.Range(0.5f, 10f); source[i] = spawn; PostUpdateCommands.CreateEntity(type); PostUpdateCommands.SetComponent(new LifeData() { Life = UnityEngine.Random.Range(0.5f, 10f) }); } } }