Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
0.8.3:prefabs [2022/04/08 10:46] – created admin0.8.3:prefabs [2022/04/08 11:35] (current) – [Assets Store (Beta)] admin
Line 1: Line 1:
-Prefabs+====== Prefabs ====== 
 + 
 +Prefabs are containers with a number of components and presets. 
 +They are comparable to *.fmx files in regular Delphi applications. 
 + 
 +Prefabs are very helpful on storing and reusing sceneries in projects. 
 +You can store complex component hierarchies like in a default FMX formular file (*.fmx). 
 +We use the read/write mechanisms for prefabs with some additional functionality. 
 + 
 +So it is also possible to store complete models with textures and animations. 
 +To unify the structure within a prefab, all components are grouped within a parent TGorillaGroup component inside the prefab file. 
 +Therefore you need to create a corresponding TGorillaGroup component to load data into. 
 + 
 +===== TGorillaPrefabSystem ===== 
 + 
 +Is a simple management component to prepare prefab loading. 
 +You can setup prefabs with their corresponding file location and load them on running the application. 
 + 
 +<file pascal> 
 +var LList : TObjectList<TComponent>; 
 +   
 +LList := TObjectList<TComponent>.Create(false); 
 +try 
 +  GorillaPrefabSystem1.LoadAllPrefabs(LList); 
 +finally 
 +  FreeAndNil(LList); 
 +end; 
 +</file> 
 + 
 +===== Runtime Usage ===== 
 + 
 +When projects getting very large, prefabs need to be loaded at runtime. Take a look at the following function on how to do it.
  
 <file pascal> <file pascal>
Line 38: Line 69:
 end; end;
 </file> </file>
 +
 +===== Assets Store (Beta) =====
 +
 +During development process prefabs became very handy and useful.
 +Like in other 3D DevTools (Unity, Unreal, ...) it is common to share those over a platform.
 +
 +We present **[[https://my.gorilla3d.de/prefabs/]]** to you!
 +
 +{{:0.8.3:g3d-assetsstore-web.jpg?nolink&600|}}
 +
 +In our assets store you can download prefabs and integrate them in your application.
 +On downloading a prefab you will receive a *.prefab or a *.prefabz file.
 +Both types can be integrated in the TGorillaPrefabSystem. Have a look at the code snippets above.
 +
 +**WARNING**: Please take care of licensing restrictions before publishing them.
 +
 +**WARNING:** //The assets store is still in beta mode! Errors may occur!//
 +
 +===== Embedded AssetsStore (Beta) =====
 +
 +Since 0.8.3.2265 we integrated the assets store also directly in the Delphi IDE.
 +
 +  - Drop a TGorillaPrefabSystem component onto your form.
 +  - Right-Click on the component in the object inspector
 +  - Click "AssetsStore" to open the embedded formular
 +  - Browse through the assets and click to directly embed them in your form
 +
 +{{:0.8.3:g3d-assetsstore-ide.jpg?nolink&600|}}
 +
 +**WARNING**: Please take care of licensing restrictions before publishing them.
 +
 +**WARNING: Some prefabs are very large in size or produce large output due to textures or animations.
 +This can exceed your memory in IDE very fast!**
 +
 +**WARNING:** //The assets store is still in beta mode! Errors may occur!//
 +
 +Next step: [[android|Android]]