Skip to content

Latest commit

 

History

History
13 lines (12 loc) · 643 Bytes

Manual-InstantiatingViews.md

File metadata and controls

13 lines (12 loc) · 643 Bytes

Instantiating Views

To instantiate view need to call thread-safe method world.InstantiateView(viewId, entity). Short method is entity.InstantiateView(viewId).

You can attach only one view on each entity at once. If you try to Instantiate second view on entity which already has view component, you'll got an exception. If you want to change view on entity - use entity.DestroyAllViews(); before calling InstantiateView.

entity.InstantiateView(this.viewSourceId);

or

this.world.InstantiateView(this.viewSourceId, entity);