ドキュメント

Unity Engine

Download Unity

Unity Engine

DefaultGameObjectInjectionWorld

The World that code running outside a system reaches for, at the top of the currently active World stack. Null until Unity creates the first World.
読み終わるまでの所要時間 1 分最終更新 23日前

Definition

  • Type: Property
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule
public static World DefaultGameObjectInjectionWorld { get; set; }

Remarks

Code that runs outside a system has no world to work from, so it reads this property instead. This applies both to your own MonoBehaviour scripts and to Editor tools such as the SubScene Inspector and the Entity Inspector. The most common use in your own code is to reach an EntityManager, for example
World.DefaultGameObjectInjectionWorld.EntityManager
.
To change which World this reports, push one onto the stack with World.ActiveWorldScope and let the scope restore the previous one.