Hide menu
Loading...
Searching...
No Matches
cadex.Unity_ObjectFactory Class Reference

Creates GameObject from ModelData_Model. More...

Public Member Functions

delegate void AsyncEndCallback (GameObject theGameObject)
 Delegate that is called upon the end of the GameObject creation in CreateAsync method. Resulting object is passed as a parameter to the delegate and can be used for further processing.
 
 Unity_ObjectFactory ()
 Constructor.
 
GameObject Create (ModelData_Model theModel, string theName, Dictionary< GameObject, ModelData_SceneGraphElement > theObjectsDictionary=null)
 Creates GameObject from ModelData_Model in the current scene with a specified name.
 
void CreateAsync (ModelData_Model theModel, string theName, AsyncEndCallback theCallback=null, Dictionary< GameObject, ModelData_SceneGraphElement > theObjectsDictionary=null)
 Asynchronously creates GameObject from ModelData_Model in the current scene with a specified name.
 
void SetParameters (Unity_ObjectFactoryParameters theParam)
 Sets parameters.
 
Unity_ObjectFactoryParameters Parameters ()
 Returns parameters.
 
void SetProgressStatus (Base_ProgressStatus theStatus)
 Sets progress status.
 
Base_ProgressStatus ProgressStatus ()
 Returns progress status.
 
void SetProgressStatusObserver (Base_ProgressStatus.Observer theObserver)
 Sets progress status observer.
 

Detailed Description

Constructor & Destructor Documentation

◆ Unity_ObjectFactory()

cadex.Unity_ObjectFactory.Unity_ObjectFactory ( )
inline

Constructor.

Exceptions
LicenseManager_LicenseErrorif no Unity add-on license was activated.

Member Function Documentation

◆ Create()

GameObject cadex.Unity_ObjectFactory.Create ( ModelData_Model  theModel,
string  theName,
Dictionary< GameObject, ModelData_SceneGraphElement theObjectsDictionary = null 
)
inline

Creates GameObject from ModelData_Model in the current scene with a specified name.

Returns just created GameObject. Pass a reference to theObjectsDictionary if you'd like to refer to the original ModelData_SceneGraphElement from the corresponding GameObject. The referenced dictionary will be filled during conversion.

Examples
Unity/Assets/Scripts/Editor/ModelLoaderWizard.cs.

◆ CreateAsync()

void cadex.Unity_ObjectFactory.CreateAsync ( ModelData_Model  theModel,
string  theName,
AsyncEndCallback  theCallback = null,
Dictionary< GameObject, ModelData_SceneGraphElement theObjectsDictionary = null 
)
inline

Asynchronously creates GameObject from ModelData_Model in the current scene with a specified name.

Use this function if you'd like the main thread of Unity to be blocked for as little time as possible during the conversion. Once the conversion is finished the callback is invoked and the resulting GameObject is passed to it. Pass a reference to theObjectsDictionary if you'd like to refer to the original ModelData_SceneGraphElement from the corresponding GameObject. The referenced dictionary will be filled during conversion.

Examples
Unity/Assets/Scripts/ModelLoader.cs.