Tanoda
TriLibCore.Samples.FaceBuilder Class Reference

Represents a TriLib sample which allows the user to load models from a website and switch between them to build a 3D face. More...

Inheritance diagram for TriLibCore.Samples.FaceBuilder:
TriLibCore.Samples.AssetViewerBase

Public Member Functions

void PreviousPart (string partName)
 Switches to the previous part. More...
 
void NextPart (string partName)
 Switches to the next part. More...
 
- Public Member Functions inherited from TriLibCore.Samples.AssetViewerBase
void ShowHelp ()
 Shows the help box. More...
 
void HideHelp ()
 Hides the help box. More...
 
void ShowModelUrlDialog ()
 Shows the model URL dialog. More...
 
void HideModelUrlDialog ()
 Hides the model URL dialog. More...
 
void LoadModelFromURLWithDialogValues ()
 Shows the URL selector for loading a model from network. More...
 
virtual void PlayAnimation ()
 Plays the selected animation. More...
 
virtual void StopAnimation ()
 Stops playing the selected animation. More...
 
virtual void PlaybackAnimationChanged (int index)
 Switches to the animation selected on the Dropdown. More...
 
virtual void PlaybackSliderChanged (float value)
 Event triggered when the animation slider value has been changed by the user. More...
 

Protected Member Functions

override void Start ()
 Checks if the Dispatcher instance exists, stores this class instance as the Singleton and load all area parts. More...
 
override void OnError (IContextualizedError contextualizedError)
 Event triggered when there is any Model loading error. More...
 
override void OnMaterialsLoad (AssetLoaderContext assetLoaderContext)
 Event triggered when the Model and all its resources loaded. More...
 
override void OnLoad (AssetLoaderContext assetLoaderContext)
 Event triggered when the Model Meshes and hierarchy are loaded. More...
 
- Protected Member Functions inherited from TriLibCore.Samples.AssetViewerBase
void UpdateCamera ()
 Updates the Camera based on mouse Input. More...
 
void LoadModelFromFile (GameObject wrapperGameObject=null, Action< AssetLoaderContext > onMaterialsLoad=null)
 Shows the file picker for loading a model from local file-system. More...
 
void LoadModelFromURL (UnityWebRequest request, string fileExtension, GameObject wrapperGameObject=null, object customData=null, Action< AssetLoaderContext > onMaterialsLoad=null)
 Loads a model from a URL. More...
 
virtual void OnBeginLoadModel (bool hasFiles)
 Event triggered when the user selects a file or cancels the Model selection dialog. More...
 
void SetLoading (bool value)
 Enables/disables the loading flag. More...
 
virtual void Start ()
 Checks if the Dispatcher instance exists and stores this class instance as the Singleton. More...
 
virtual void OnProgress (AssetLoaderContext assetLoaderContext, float value)
 Event is triggered when the Model loading progress changes. More...
 
virtual void OnError (IContextualizedError contextualizedError)
 Event is triggered when any error occurs. More...
 
virtual void OnLoad (AssetLoaderContext assetLoaderContext)
 Event is triggered when the Model Meshes and hierarchy are loaded. More...
 
virtual void OnMaterialsLoad (AssetLoaderContext assetLoaderContext)
 Event is triggered when the Model (including Textures and Materials) has been fully loaded. More...
 

Additional Inherited Members

- Public Attributes inherited from TriLibCore.Samples.AssetViewerBase
Vector2 CameraAngle
 Current camera pitch and yaw angles. More...
 
- Protected Attributes inherited from TriLibCore.Samples.AssetViewerBase
Slider PlaybackSlider
 Animation playback slider. More...
 
Text PlaybackTime
 Animation playback time. More...
 
Dropdown PlaybackAnimation
 Animation selector. More...
 
Selectable Play
 Play button. More...
 
Selectable Stop
 Stop button. More...
 
AssetLoaderOptions AssetLoaderOptions
 Options used in this sample. More...
 
- Static Protected Attributes inherited from TriLibCore.Samples.AssetViewerBase
const float InputMultiplierRatio = 0.1f
 Mouse input multiplier. Higher values will make the mouse movement more sensible. More...
 
const float MaxPitch = 80f
 Maximum camera pitch and light pitch (rotation around local X-axis). More...
 
- Properties inherited from TriLibCore.Samples.AssetViewerBase
static AssetViewerBase Instance [get]
 Gets the Asset Viewer Singleton instance. More...
 
GameObject RootGameObject [get, protected set]
 Loaded game object. More...
 

Detailed Description

Represents a TriLib sample which allows the user to load models from a website and switch between them to build a 3D face.

Definition at line 12 of file FaceBuilder.cs.

Member Function Documentation

◆ NextPart()

void TriLibCore.Samples.FaceBuilder.NextPart ( string  partName)

Switches to the next part.

Parameters
partNameThe area name to switch (hair, eyes, nose or mouth).

Definition at line 47 of file FaceBuilder.cs.

◆ OnError()

override void TriLibCore.Samples.FaceBuilder.OnError ( IContextualizedError  contextualizedError)
protectedvirtual

Event triggered when there is any Model loading error.

Parameters
contextualizedErrorThe Contextualized Error that has occurred.

Reimplemented from TriLibCore.Samples.AssetViewerBase.

Definition at line 137 of file FaceBuilder.cs.

◆ OnLoad()

override void TriLibCore.Samples.FaceBuilder.OnLoad ( AssetLoaderContext  assetLoaderContext)
protectedvirtual

Event triggered when the Model Meshes and hierarchy are loaded.

Parameters
assetLoaderContextThe Asset Loader Context reference. Asset Loader Context contains the Model loading data.

Reimplemented from TriLibCore.Samples.AssetViewerBase.

Definition at line 180 of file FaceBuilder.cs.

◆ OnMaterialsLoad()

override void TriLibCore.Samples.FaceBuilder.OnMaterialsLoad ( AssetLoaderContext  assetLoaderContext)
protectedvirtual

Event triggered when the Model and all its resources loaded.

Parameters
assetLoaderContextThe Asset Loader Context reference. Asset Loader Context contains the Model loading data.

Reimplemented from TriLibCore.Samples.AssetViewerBase.

Definition at line 159 of file FaceBuilder.cs.

◆ PreviousPart()

void TriLibCore.Samples.FaceBuilder.PreviousPart ( string  partName)

Switches to the previous part.

Parameters
partNameThe area name to switch (hair, eyes, nose or mouth).

Definition at line 38 of file FaceBuilder.cs.

◆ Start()

override void TriLibCore.Samples.FaceBuilder.Start ( )
protectedvirtual

Checks if the Dispatcher instance exists, stores this class instance as the Singleton and load all area parts.

Reimplemented from TriLibCore.Samples.AssetViewerBase.

Definition at line 124 of file FaceBuilder.cs.


The documentation for this class was generated from the following file: