Esempio n. 1
0
 protected override void OnCreate()
 {
     querySystem = EntityManager.World.GetOrCreateSystem <NavMeshQuerySystem>();
     querySystem.RegisterPathResolvedCallback(OnPathSuccess);
     querySystem.RegisterPathFailedCallback(OnPathError);
     needsWaypoint   = new NativeQueue <AgentData> (Allocator.Persistent);
     pathFindingData = new NativeHashMap <int, AgentData> (0, Allocator.Persistent);
     queryUpdate     = GetEntityQuery(typeof(NavAgentComponent));
 }
        protected override void OnCreate()
        {
            base.OnCreate();
            querySystem = World.GetOrCreateSystem <NavMeshQuerySystem>();

            querySystem.RegisterPathResolvedCallback(OnPathSuccess);
            querySystem.RegisterPathFailedCallback(OnPathError);

            pathFindingData       = new NativeHashMap <int, AgentData>(0, Allocator.Persistent);
            setPathResultCommands = new NativeQueue <AgentData>(Allocator.Persistent);
        }
        protected override void OnCreate()
        {
            var agentQueryDesc = new EntityQueryDesc
            {
                All = new ComponentType[] { typeof(NavAgent), typeof(NavAgentAvoidance) }
            };

            _agentQuery     = GetEntityQuery(agentQueryDesc);
            _navMeshQuery   = new NavMeshQuery(NavMeshWorld.GetDefaultWorld(), Allocator.Persistent, 128);
            IndexMap        = new NativeMultiHashMap <int, int>(100 * 1024, Allocator.Persistent);
            NextPositionMap = new NativeMultiHashMap <int, float3>(100 * 1024, Allocator.Persistent);
            _querySystem    = World.GetOrCreateSystem <NavMeshQuerySystem>();
        }