Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
        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)
                    });
                }
            }
        }