#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_);
                }
            }
        }
            public void Execute(int i)
            {
                var random = random_list_[i];
                var pos    = new float3(0f, 0f, 0f);
                var vel    = random.onSphere(10f);

                ECSBulletManager.spawnBullet(command_buffer_,
                                             time_,
                                             ref pos,
                                             ref vel);
                vel = random.onSphere(10f);
                ECSBulletManager.spawnEnemyBullet(command_buffer_,
                                                  time_,
                                                  ref pos,
                                                  ref vel);
                random_list_[i] = random;
            }
示例#3
0
        protected override void OnUpdate()
        {
            var time = Time.GetCurrent();

            for (var i = 0; i < group_.random_list_.Length; ++i)
            {
                var random = group_.random_list_[i];
                var pos    = new float3(0f, 0f, 0f);
                var vel    = random.onSphere(10f);
                ECSBulletManager.spawnBullet(PostUpdateCommands,
                                             time,
                                             ref pos,
                                             ref vel);
                vel = random.onSphere(10f);
                ECSBulletManager.spawnEnemyBullet(PostUpdateCommands,
                                                  time,
                                                  ref pos,
                                                  ref vel);
                group_.random_list_[i] = random;
            }
        }