Tanoda
TriLibCore.Samples.AssetViewerBase Class Reference

Represents a base class used in TriLib samples. More...

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

Public Member Functions

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...
 

Public Attributes

Vector2 CameraAngle
 Current camera pitch and yaw angles. More...
 

Protected Member Functions

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...
 

Protected Attributes

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

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

static AssetViewerBase Instance [get]
 Gets the Asset Viewer Singleton instance. More...
 
GameObject RootGameObject [get, protected set]
 Loaded game object. More...
 

Detailed Description

Represents a base class used in TriLib samples.

Definition at line 11 of file AssetViewerBase.cs.

Member Function Documentation

◆ HideHelp()

void TriLibCore.Samples.AssetViewerBase.HideHelp ( )

Hides the help box.

Definition at line 110 of file AssetViewerBase.cs.

◆ HideModelUrlDialog()

void TriLibCore.Samples.AssetViewerBase.HideModelUrlDialog ( )

Hides the model URL dialog.

Definition at line 128 of file AssetViewerBase.cs.

◆ LoadModelFromFile()

void TriLibCore.Samples.AssetViewerBase.LoadModelFromFile ( GameObject  wrapperGameObject = null,
Action< AssetLoaderContext >  onMaterialsLoad = null 
)
protected

Shows the file picker for loading a model from local file-system.

Definition at line 137 of file AssetViewerBase.cs.

◆ LoadModelFromURL()

void TriLibCore.Samples.AssetViewerBase.LoadModelFromURL ( UnityWebRequest  request,
string  fileExtension,
GameObject  wrapperGameObject = null,
object  customData = null,
Action< AssetLoaderContext >  onMaterialsLoad = null 
)
protected

Loads a model from a URL.

Definition at line 148 of file AssetViewerBase.cs.

◆ LoadModelFromURLWithDialogValues()

void TriLibCore.Samples.AssetViewerBase.LoadModelFromURLWithDialogValues ( )

Shows the URL selector for loading a model from network.

Definition at line 164 of file AssetViewerBase.cs.

◆ OnBeginLoadModel()

virtual void TriLibCore.Samples.AssetViewerBase.OnBeginLoadModel ( bool  hasFiles)
protectedvirtual

Event triggered when the user selects a file or cancels the Model selection dialog.

Parameters
hasFilesIf any file has been selected, this value is true, otherwise it is false.

Reimplemented in TriLibCore.Samples.AssetViewer.

Definition at line 175 of file AssetViewerBase.cs.

◆ OnError()

virtual void TriLibCore.Samples.AssetViewerBase.OnError ( IContextualizedError  contextualizedError)
protectedvirtual

Event is triggered when any error occurs.

Parameters
contextualizedErrorThe Contextualized Error that has occurred.

Reimplemented in TriLibCore.Samples.AssetViewer, and TriLibCore.Samples.FaceBuilder.

Definition at line 224 of file AssetViewerBase.cs.

◆ OnLoad()

virtual void TriLibCore.Samples.AssetViewerBase.OnLoad ( AssetLoaderContext  assetLoaderContext)
protectedvirtual

Event is triggered when the Model Meshes and hierarchy are loaded.

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

Reimplemented in TriLibCore.Samples.AssetViewer, and TriLibCore.Samples.FaceBuilder.

Definition at line 236 of file AssetViewerBase.cs.

◆ OnMaterialsLoad()

virtual void TriLibCore.Samples.AssetViewerBase.OnMaterialsLoad ( AssetLoaderContext  assetLoaderContext)
protectedvirtual

Event is triggered when the Model (including Textures and Materials) has been fully loaded.

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

Reimplemented in TriLibCore.Samples.AssetViewer, TriLibCore.Samples.AvatarLoader, and TriLibCore.Samples.FaceBuilder.

Definition at line 245 of file AssetViewerBase.cs.

◆ OnProgress()

virtual void TriLibCore.Samples.AssetViewerBase.OnProgress ( AssetLoaderContext  assetLoaderContext,
float  value 
)
protectedvirtual

Event is triggered when the Model loading progress changes.

Parameters
assetLoaderContextThe Asset Loader Context reference. Asset Loader Context contains the Model loading data.
valueThe loading progress, ranging from 0 to 1.

Definition at line 217 of file AssetViewerBase.cs.

◆ PlayAnimation()

virtual void TriLibCore.Samples.AssetViewerBase.PlayAnimation ( )
virtual

Plays the selected animation.

Reimplemented in TriLibCore.Samples.AssetViewer.

Definition at line 253 of file AssetViewerBase.cs.

◆ PlaybackAnimationChanged()

virtual void TriLibCore.Samples.AssetViewerBase.PlaybackAnimationChanged ( int  index)
virtual

Switches to the animation selected on the Dropdown.

Parameters
indexThe selected Animation index.

Reimplemented in TriLibCore.Samples.AssetViewer.

Definition at line 264 of file AssetViewerBase.cs.

◆ PlaybackSliderChanged()

virtual void TriLibCore.Samples.AssetViewerBase.PlaybackSliderChanged ( float  value)
virtual

Event triggered when the animation slider value has been changed by the user.

Parameters
valueThe Animation playback normalized position.

Reimplemented in TriLibCore.Samples.AssetViewer.

Definition at line 272 of file AssetViewerBase.cs.

◆ SetLoading()

void TriLibCore.Samples.AssetViewerBase.SetLoading ( bool  value)
protected

Enables/disables the loading flag.

Parameters
valueThe new loading flag.

Definition at line 188 of file AssetViewerBase.cs.

◆ ShowHelp()

void TriLibCore.Samples.AssetViewerBase.ShowHelp ( )

Shows the help box.

Definition at line 102 of file AssetViewerBase.cs.

◆ ShowModelUrlDialog()

void TriLibCore.Samples.AssetViewerBase.ShowModelUrlDialog ( )

Shows the model URL dialog.

Definition at line 118 of file AssetViewerBase.cs.

◆ Start()

virtual void TriLibCore.Samples.AssetViewerBase.Start ( )
protectedvirtual

Checks if the Dispatcher instance exists and stores this class instance as the Singleton.

Reimplemented in TriLibCore.Samples.AssetViewer, TriLibCore.Samples.AvatarLoader, and TriLibCore.Samples.FaceBuilder.

Definition at line 204 of file AssetViewerBase.cs.

◆ StopAnimation()

virtual void TriLibCore.Samples.AssetViewerBase.StopAnimation ( )
virtual

Stops playing the selected animation.

Reimplemented in TriLibCore.Samples.AssetViewer.

Definition at line 258 of file AssetViewerBase.cs.

◆ UpdateCamera()

void TriLibCore.Samples.AssetViewerBase.UpdateCamera ( )
protected

Updates the Camera based on mouse Input.

Definition at line 93 of file AssetViewerBase.cs.

Member Data Documentation

◆ AssetLoaderOptions

AssetLoaderOptions TriLibCore.Samples.AssetViewerBase.AssetLoaderOptions
protected

Options used in this sample.

Definition at line 69 of file AssetViewerBase.cs.

◆ CameraAngle

Vector2 TriLibCore.Samples.AssetViewerBase.CameraAngle

Current camera pitch and yaw angles.

Definition at line 74 of file AssetViewerBase.cs.

◆ InputMultiplierRatio

const float TriLibCore.Samples.AssetViewerBase.InputMultiplierRatio = 0.1f
staticprotected

Mouse input multiplier. Higher values will make the mouse movement more sensible.

Definition at line 85 of file AssetViewerBase.cs.

◆ MaxPitch

const float TriLibCore.Samples.AssetViewerBase.MaxPitch = 80f
staticprotected

Maximum camera pitch and light pitch (rotation around local X-axis).

Definition at line 90 of file AssetViewerBase.cs.

◆ Play

Selectable TriLibCore.Samples.AssetViewerBase.Play
protected

Play button.

Definition at line 59 of file AssetViewerBase.cs.

◆ PlaybackAnimation

Dropdown TriLibCore.Samples.AssetViewerBase.PlaybackAnimation
protected

Animation selector.

Definition at line 54 of file AssetViewerBase.cs.

◆ PlaybackSlider

Slider TriLibCore.Samples.AssetViewerBase.PlaybackSlider
protected

Animation playback slider.

Definition at line 44 of file AssetViewerBase.cs.

◆ PlaybackTime

Text TriLibCore.Samples.AssetViewerBase.PlaybackTime
protected

Animation playback time.

Definition at line 49 of file AssetViewerBase.cs.

◆ Stop

Selectable TriLibCore.Samples.AssetViewerBase.Stop
protected

Stop button.

Definition at line 64 of file AssetViewerBase.cs.

Property Documentation

◆ Instance

AssetViewerBase TriLibCore.Samples.AssetViewerBase.Instance
staticget

Gets the Asset Viewer Singleton instance.

Definition at line 14 of file AssetViewerBase.cs.

◆ RootGameObject

GameObject TriLibCore.Samples.AssetViewerBase.RootGameObject
getprotected set

Loaded game object.

Definition at line 79 of file AssetViewerBase.cs.


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