コード例 #1
0
        public NavMeshQuery(NavMeshWorld world, Allocator allocator, int pathNodePoolSize = 0)
        {
            if (!world.IsValid())
            {
                throw new ArgumentNullException("world", "Invalid world");
            }
            m_NavMeshQuery = Create(world, pathNodePoolSize);

            DisposeSentinel.Create(out m_Safety, out m_DisposeSentinel, 0, allocator);
            AddQuerySafety(m_NavMeshQuery, m_Safety);
        }
コード例 #2
0
        public NavMeshQuery(NavMeshWorld world, Allocator allocator, int pathNodePoolSize = 0)
        {
            bool flag = !world.IsValid();

            if (flag)
            {
                throw new ArgumentNullException("world", "Invalid world");
            }
            this.m_NavMeshQuery = NavMeshQuery.Create(world, pathNodePoolSize);
            DisposeSentinel.Create(out this.m_Safety, out this.m_DisposeSentinel, 0, allocator);
            NavMeshQuery.AddQuerySafety(this.m_NavMeshQuery, this.m_Safety);
        }
コード例 #3
0
        public NavMeshQuery(NavMeshWorld world, Allocator allocator, int pathNodePoolSize = 0)
        {
            if (!world.IsValid())
            {
                throw new ArgumentNullException("world", "Invalid world");
            }

            if (pathNodePoolSize < 0 || pathNodePoolSize > ushort.MaxValue)
            {
                throw new ArgumentException($"The path node pool size ({pathNodePoolSize}) must be greater than or equal to 0 and less than {ushort.MaxValue + 1}.");
            }
            m_NavMeshQuery = Create(world, pathNodePoolSize);

            DisposeSentinel.Create(out m_Safety, out m_DisposeSentinel, 0, allocator);
            AddQuerySafety(m_NavMeshQuery, m_Safety);
        }
コード例 #4
0
        public NavMeshQuery(NavMeshWorld world, Allocator allocator, int pathNodePoolSize = 0)
        {
            if (!world.IsValid())
            {
                throw new ArgumentNullException("world", "Invalid world");
            }

            if (pathNodePoolSize < 0 || pathNodePoolSize > ushort.MaxValue)
            {
                throw new ArgumentException($"The path node pool size ({pathNodePoolSize}) must be greater than or equal to 0 and less than {ushort.MaxValue + 1}.");
            }
            m_NavMeshQuery = Create(world, pathNodePoolSize);

            UnsafeUtility.LeakRecord(m_NavMeshQuery, LeakCategory.NavMeshQuery, 0);
            AtomicSafetyHandle.CreateHandle(out m_Safety, allocator);
            AddQuerySafety(m_NavMeshQuery, m_Safety);
        }