文档

Unity Engine

Download Unity

Unity Engine

sourceWorld

Get the world this space is bound to, or a default (invalid) world if the space is not bound. A space is bound by creating it with the world overload of Create.
阅读时间1 分钟最后更新于 5 天前

Definition

  • Type: Property
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public PhysicsWorld sourceWorld { get; }

Remarks

Destroying the world does not destroy the space, including when a scene load destroys the world. The space keeps its proxies, and this property then returns a world whose PhysicsWorld.isValid is false. Every method that needs the world, such as PhysicsSpace.SyncShapes, then throws InvalidOperationException. See PhysicsSpace.Create and PhysicsWorld.SceneLoadMode.