Пример #1
0
#pragma warning restore 0169

        protected override void OnUpdate()
        {
            PlayerSystem.Sync();
            ZakoSystem.Sync();
            var             spawner = ECSBulletManager.GetBulletSpawnDataQueue();
            BulletSpawnData data;

            while (spawner.TryDequeue(out data))
            {
                if (data.type_ == 0)
                {
                    ECSBulletManager.spawnBullet(PostUpdateCommands,
                                                 Time.GetCurrent(),
                                                 ref data.position_,
                                                 ref data.velocity_);
                }
                else
                {
                    ECSBulletManager.spawnEnemyBullet(PostUpdateCommands,
                                                      Time.GetCurrent(),
                                                      ref data.position_,
                                                      ref data.velocity_);
                }
            }
        }
#pragma warning restore 0169

        protected override void OnUpdate()
        {
            LaserSystem.Sync();
            ZakoSystem.Sync();

            var spawner = ECSExplosionManager.GetExplosionSpawnDataQueue();
            ExplosionSpawnData data;

            while (spawner.TryDequeue(out data))
            {
                ECSExplosionManager.spawn(PostUpdateCommands,
                                          Time.GetCurrent(),
                                          ref data.position_,
                                          0f /* rotation1 */);
            }
        }