public PhysicsObjectsFactory(EcsWorld world, EcsWorld worldConstraints) { this.world = world; this.worldConstraints = worldConstraints; rigidBodies = world.GetPool <RigidBody>(); staticBodies = world.GetPool <StaticBody>(); velocities = world.GetPool <Velocity>(); poses = world.GetPool <Pose>(); bodyMasks = world.GetPool <BodyMask>(); circleShapes = world.GetPool <Circle>(); segmentShapes = world.GetPool <Segment>(); meshShapes = world.GetPool <Mesh>(); aaboxShapes = world.GetPool <AABox>(); bboxes = world.GetPool <BoundingBox>(); springsBodyBody = worldConstraints.GetPool <SpringBodyBody>(); springsBodySpace = worldConstraints.GetPool <SpringBodySpace>(); }
public void Init() { _world.GetPool <Movable> ().SetCapacity(_lss.Count); for (int i = 0, iMax = _lss.Count; i < iMax; i++) { ref var movable = ref _world.NewEntity().Get <Movable> (); movable.Position = new Float3(Random.Range(-100f, 100f), Random.Range(-100f, 100f), Random.Range(-100f, 100f)); movable.View = Object.Instantiate(_lss.Prefab, movable.Position, Quaternion.identity); }
public void Init() { _world.GetPool <Movable>().SetCapacity(_lss.Count); for (int i = 0, iMax = _lss.Count; i < iMax; i++) { ref var movable = ref _world.NewEntity().Get <Movable>(); movable.Position = new Float3( Random.Range(-100f, 100f), Random.Range(-100f, 100f), Random.Range(-100f, 100f)); }
private void RegisterAutoReset() { world .GetPool <CameraTargetFollowComponent>() .SetAutoReset(CameraTargetFollowComponent.CustomReset); }
public int AddLabel(string text, Vector2 position) { var entity = world.NewEntity(); var posPool = world.GetPool <UIPosition>(); ref UIPosition p = ref posPool.Add(entity);