A bug with the compiler confused with // and [] ?

getting this

5325492--536100--upload_2019-12-30_16-56-28.png

on that

using System;
using Unity.Collections;
using Unity.Entities;
using Unity.Jobs;
using Unity.Mathematics;
using UnityEngine;
using static Unity.Mathematics.math;
using Unity.Transforms;
using UnityEngine.UIElements;

//[GenerateAuthoringComponent]
//public struct InstanceData : IComponentData
//{
//    public GameObject  conveyorEnd1, conveyorMiddle, conveyorEnd2;
//    public int howMany;
//}

//[UpdateInGroup(typeof(InitializationSystemGroup))]
//public class ShakerSystem : JobComponentSystem
//{
//    protected override JobHandle OnUpdate(JobHandle inputDependencies)
//    {
//        var rnd = randomGenerator.NextFloat3(new Unity.Mathematics.float3(.5f, .5f, .5f));
//        var job = Entities.ForEach((ref Translation translation, in GridPosition gridPosition) =>
//        {
//            translation.Value += rnd * distance(translation.Value, gridPosition.Value);
//        }).Schedule(inputDependencies);

//        return job;
//    }
//}

public class Instantiator : MonoBehaviour
{
    public int howMany = 10000;
    public GameObject conveyorMiddle;

    private void Start()
    {
        for (int i = 0; i < howMany; i++)
        {
            var c = World.DefaultGameObjectInjectionWorld.EntityManager.Instantiate(conveyorMiddle);
            World.DefaultGameObjectInjectionWorld.EntityManager.SetComponentData(c, new Translation{ Value = UnityEngine.Random.insideUnitSphere * 100 });
            World.DefaultGameObjectInjectionWorld.EntityManager .SetComponentData(c, new Rotation{ Value = UnityEngine.Random.rotation});
        }
    }
}

yep confirming this is a bug, if you delete the commented code it passes, if you put it back it fails

It fixed in 2020 version afaik.

1 Like

cool thanks