AABB
AlignmentBehavior
ArriveBehavior
AStar
BFS
BoundingSphere
BVH
BVHNode
Cell
CellSpacePartitioning
CohesionBehavior
CompositeGoal
ConvexHull
Corridor
CostTable
DFS
Dijkstra
Edge
EntityManager
EvadeBehavior
EventDispatcher
Behavior
FollowPathBehavior
FuzzyAND
FuzzyCompositeTerm
FuzzyFAIRLY
FuzzyModule
FuzzyOR
FuzzyRule
FuzzySet
FuzzyTerm
FuzzyVariable
FuzzyVERY
GameEntity
Goal
GoalEvaluator
Graph
GraphUtils
HalfEdge
HeuristicPolicyDijkstra
HeuristicPolicyEuclid
HeuristicPolicyEuclidSquared
HeuristicPolicyManhattan
InterposeBehavior
LeftSCurveFuzzySet
LeftShoulderFuzzySet
LineSegment
Logger
MathUtils
Matrix3
Matrix4
MemoryRecord
MemorySystem
MeshGeometry
MessageDispatcher
MovingEntity
NavEdge
NavMesh
NavMeshLoader
NavNode
Node
NormalDistFuzzySet
OBB
ObstacleAvoidanceBehavior
OffsetPursuitBehavior
OnPathBehavior
Path
Plane
Polygon
Polyhedron
PriorityQueue
PursuitBehavior
Quaternion
Ray
RectangleTriggerRegion
Regular
RightSCurveFuzzySet
RightShoulderFuzzySet
SAT
SeekBehavior
SeparationBehavior
SingletonFuzzySet
Smoother
SphericalTriggerRegion
State
StateMachine
SteeringBehavior
SteeringManager
Task
TaskQueue
Telegram
Think
Time
TriangularFuzzySet
Trigger
TriggerRegion
Vector3
Vehicle
Version
WanderBehavior

Children

描述

childrenVehicle 类的一个属性,用于存储当前车辆所拥有的子级。

语法

vehicle.children

示例

const vehicle = new Vehicle();
const car = new Vehicle();
const bike = new Vehicle();
vehicle.addToChildren(car);
vehicle.addToChildren(bike);
console.log(vehicle.children); // 输出:[car, bike]

方法

addToChildren(child)

将一个子级 child 添加到 vehicle.children 数组中。

参数

  • child:要添加的子级车辆

返回值

  • 无返回值

removeFromChildren(child)

vehicle.children 数组中删除一个子级 child

参数

  • child:要删除的子级车辆

返回值

  • 无返回值

getChildren()

获取当前车辆的所有子级。

返回值

  • 一个包含所有子级车辆的数组

hasChildren()

检查当前车辆是否拥有子级。

返回值

  • true:当前车辆拥有子级
  • false:当前车辆没有子级