예제 #1
0
        protected override void OnStartRunning()
        {
            AgentRenderer = BioCrowdsBootStrap.GetLookFromPrototype("AgentRenderer");
            UpdateInjectedComponentGroups();

            lastAgentId = 0;
            //If bioclouds isn't enabled we must use other job to spawn the agents
            //Here we get the necessary data from the experiment file
            if (!Settings.experiment.BioCloudsEnabled)
            {
                var exp = Settings.experiment.SpawnAreas;

                parBuffer = new NativeList <Parameters>(exp.Length, Allocator.Persistent);

                for (int i = 0; i < exp.Length; i++)
                {
                    Parameters par = new Parameters
                    {
                        cloud           = i,
                        goal            = exp[i].goal,
                        maxSpeed        = exp[i].maxSpeed,
                        qtdAgents       = exp[i].qtd,
                        spawnOrigin     = exp[i].min,
                        spawnDimensions = new float2(exp[i].max.x, exp[i].max.z)
                    };

                    parBuffer.Add(par);
                }
                AgentAtCellQuantity = new NativeArray <int>(parBuffer.Length, Allocator.Persistent);
            }
            else
            {
                AgentAtCellQuantity = new NativeArray <int>(m_CellGroup.Length, Allocator.Persistent);
            }
        }
예제 #2
0
        protected override void OnStartRunning()
        {
            var entityManager = World.Active.GetOrCreateManager <EntityManager>();

            MakerArchetype = entityManager.CreateArchetype(
                ComponentType.Create <Position>(),
                ComponentType.Create <CellName>(),
                //ComponentType.Create<Active>(),
                ComponentType.Create <MarkerData>());
            MarkerRenderer = BioCrowdsBootStrap.GetLookFromPrototype("MarkerMesh");
        }