Ejemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();

            UrgPort.processDel = new UrgPort.processData(processMethod);
            updateBoardDel     = new updateBoard(update);
        }
Ejemplo n.º 2
0
        public Form1()
        {
            InitializeComponent();

            // 绑定更新界面方法
            updateBoardDel += new updateBoard(this.updateBoardMethod);
        }
Ejemplo n.º 3
0
    protected override void OnUpdate()
    {
        MeshInstanceRenderer MSI = Bootstrap.Settings.MSI.Value;

        MSI.material = Bootstrap.Settings.mat;

        MSI.mesh = Bootstrap.Settings.mesh;

        MeshInstanceRenderer MSIW = Bootstrap.Settings.MSI.Value;

        MSIW.material = Bootstrap.Settings.matW;

        MSIW.mesh = Bootstrap.Settings.mesh;
        int births = 0, deaths = 0, stables = 0;
        var job = new updateJob()
        {
            pos        = _data.pos,
            col        = _data.col,
            Board      = Bootstrap.Board,
            halfHeight = Bootstrap.halfDistanceHeight,
            halfWidth  = Bootstrap.halfDistanceWidth,
            width      = Bootstrap.Settings.width,
            //CB = _stateUpdateBarrier.CreateCommandBuffer(),
            //MSIB = MSI,
            //MSIW = MSIW,
            //EA = _data.entity
        };
        JobHandle jobHandle = job.Schedule(Bootstrap.Board.Length, Bootstrap.Board.Length / SystemInfo.processorCount);

        JobHandle uBoard = new updateBoard()
        {
            col        = _data.col,
            Board      = Bootstrap.Board,
            halfHeight = Bootstrap.halfDistanceHeight,
            halfWidth  = Bootstrap.halfDistanceWidth,
            pos        = _data.pos,
            width      = Bootstrap.Settings.width
        }.Schedule(jobHandle);

        //Debug.Log("stables: " + stables + " deaths: " + deaths + " and births: " + births);

        uBoard.Complete();


        //      int changesTemp = 0;

        for (int i = 0; i < _data.col.Length; i++)
        {
            if (_data.msi[i].material.color.b != _data.col[i].Value)
            {
                //              changesTemp++;

                if (_data.msi[i].material.color.b == 1)
                {
                    PostUpdateCommands.SetSharedComponent <MeshInstanceRenderer>(_data.entity[i], MSI);
                }
                else
                {
                    PostUpdateCommands.SetSharedComponent <MeshInstanceRenderer>(_data.entity[i], MSIW);
                }
            }
        }

        //changesTemp = 0;
    }