public void InstantiateView(DrawMeshViewSourceBase prefab, Entity entity) { if (prefab == null) { ViewSourceIsNullException.Throw(); } this.InstantiateView(prefab.GetSource(), entity); }
public ViewId RegisterViewSource(DrawMeshViewSourceBase prefab) { if (prefab == null) { ViewSourceIsNullException.Throw(); } return(this.RegisterViewSource(new UnityDrawMeshProviderInitializer(), prefab.GetSource())); }
public ViewId RegisterViewSource(UnityGameObjectProviderInitializer providerInitializer, UnityEngine.GameObject prefab) { if (prefab == null) { ViewSourceIsNullException.Throw(); } if (prefab.TryGetComponent(out IView component) == true) { return(this.RegisterViewSource(providerInitializer, component)); } return(ViewId.Zero); }
public static ViewId RegisterViewSource <TProvider>(this ViewsModule viewsModule, TProvider providerInitializer, UnityEngine.AddressableAssets.AssetReference addressablePrefab) where TProvider : struct, IViewsProviderInitializer { if (addressablePrefab == null) { ViewSourceIsNullException.Throw(); } #if VIEWS_REGISTER_VIEW_SOURCE_CHECK_STATE if (viewsModule.world.HasStep(WorldStep.LogicTick) == true) { throw new InStateException(); } #endif var handle = addressablePrefab.LoadAssetAsync <IView>(); var prefab = handle.WaitForCompletion(); return(viewsModule.RegisterViewSource(providerInitializer, prefab)); }