Tanoda
|
Represents a TriLib sample which allows the user to load models and HDR skyboxes from the local file-system. More...
Public Member Functions | |
void | LoadModelFromFile () |
Shows the file picker for loading a model from the local file-system. More... | |
void | LoadSkyboxFromFile () |
Shows the file picker for loading a skybox from the local file-system. More... | |
void | ClearSkybox () |
Removes the skybox texture. More... | |
void | ResetModelScale () |
override void | PlayAnimation () |
Plays the selected animation. More... | |
override void | StopAnimation () |
Stop playing the selected animation. More... | |
override void | PlaybackAnimationChanged (int index) |
Switches to the animation selected on the Dropdown. More... | |
override void | PlaybackSliderChanged (float value) |
Event triggered when the Animation slider value has been changed by the user. More... | |
void | OnSkyboxExposureChanged (float exposure) |
Event triggered when the skybox exposure Slider has changed. More... | |
![]() | |
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 () |
Initializes the base-class and clears the skybox Texture. More... | |
virtual void | ProcessInput () |
Handles the input and moves the Camera accordingly. More... | |
override void | OnBeginLoadModel (bool hasFiles) |
Event triggered when the user selects a file or cancels the Model selection dialog. More... | |
override void | OnLoad (AssetLoaderContext assetLoaderContext) |
Event triggered when the Model Meshes and hierarchy are loaded. More... | |
virtual void | ModelTransformChanged () |
Changes the camera placement when the Model has changed. More... | |
override void | OnError (IContextualizedError contextualizedError) |
Event is triggered when any error occurs. More... | |
override void | OnMaterialsLoad (AssetLoaderContext assetLoaderContext) |
Event is triggered when the Model (including Textures and Materials) has been fully loaded. More... | |
![]() | |
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 | |
GameObject | Skybox |
Skybox game object. More... | |
float | CameraDistance = 1f |
Current camera distance. More... | |
Vector3 | CameraPivot |
Current camera pivot position. More... | |
float | InputMultiplier = 1f |
Input multiplier based on loaded model bounds. More... | |
![]() | |
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 | CameraDistanceRatio = 2f |
Camera distance ratio based on model bounds. More... | |
const float | MinCameraDistance = 0.01f |
minimum camera distance. More... | |
const float | SkyboxScale = 100f |
Skybox scale based on model bounds. More... | |
![]() | |
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... | |
Additional Inherited Members | |
![]() | |
Vector2 | CameraAngle |
Current camera pitch and yaw angles. More... | |
![]() | |
static AssetViewerBase | Instance [get] |
Gets the Asset Viewer Singleton instance. More... | |
GameObject | RootGameObject [get, protected set] |
Loaded game object. More... | |
Represents a TriLib sample which allows the user to load models and HDR skyboxes from the local file-system.
Definition at line 17 of file AssetViewer.cs.
void TriLibCore.Samples.AssetViewer.ClearSkybox | ( | ) |
Removes the skybox texture.
Definition at line 147 of file AssetViewer.cs.
void TriLibCore.Samples.AssetViewer.LoadModelFromFile | ( | ) |
Shows the file picker for loading a model from the local file-system.
Definition at line 125 of file AssetViewer.cs.
void TriLibCore.Samples.AssetViewer.LoadSkyboxFromFile | ( | ) |
Shows the file picker for loading a skybox from the local file-system.
Definition at line 133 of file AssetViewer.cs.
|
protectedvirtual |
Changes the camera placement when the Model has changed.
Definition at line 412 of file AssetViewer.cs.
|
protectedvirtual |
Event triggered when the user selects a file or cancels the Model selection dialog.
hasFiles | If any file has been selected, this value is true , otherwise it is false . |
Reimplemented from TriLibCore.Samples.AssetViewerBase.
Definition at line 358 of file AssetViewer.cs.
|
protectedvirtual |
Event is triggered when any error occurs.
contextualizedError | The Contextualized Error that has occurred. |
Reimplemented from TriLibCore.Samples.AssetViewerBase.
Definition at line 430 of file AssetViewer.cs.
|
protectedvirtual |
Event triggered when the Model Meshes and hierarchy are loaded.
assetLoaderContext | The Asset Loader Context reference. Asset Loader Context contains the Model loading data. |
Reimplemented from TriLibCore.Samples.AssetViewerBase.
Definition at line 369 of file AssetViewer.cs.
|
protectedvirtual |
Event is triggered when the Model (including Textures and Materials) has been fully loaded.
assetLoaderContext | The Asset Loader Context reference. Asset Loader Context contains the Model loading data. |
Reimplemented from TriLibCore.Samples.AssetViewerBase.
Definition at line 437 of file AssetViewer.cs.
void TriLibCore.Samples.AssetViewer.OnSkyboxExposureChanged | ( | float | exposure | ) |
Event triggered when the skybox exposure Slider has changed.
exposure | The new exposure value. |
Definition at line 259 of file AssetViewer.cs.
|
virtual |
Plays the selected animation.
Reimplemented from TriLibCore.Samples.AssetViewerBase.
Definition at line 163 of file AssetViewer.cs.
|
virtual |
Switches to the animation selected on the Dropdown.
index | The selected Animation index. |
Reimplemented from TriLibCore.Samples.AssetViewerBase.
Definition at line 182 of file AssetViewer.cs.
|
virtual |
Event triggered when the Animation slider value has been changed by the user.
value | The Animation playback normalized position. |
Reimplemented from TriLibCore.Samples.AssetViewerBase.
Definition at line 189 of file AssetViewer.cs.
|
protectedvirtual |
Handles the input and moves the Camera accordingly.
Definition at line 285 of file AssetViewer.cs.
void TriLibCore.Samples.AssetViewer.ResetModelScale | ( | ) |
Definition at line 155 of file AssetViewer.cs.
|
protectedvirtual |
Initializes the base-class and clears the skybox Texture.
Reimplemented from TriLibCore.Samples.AssetViewerBase.
Definition at line 269 of file AssetViewer.cs.
|
virtual |
Stop playing the selected animation.
Reimplemented from TriLibCore.Samples.AssetViewerBase.
Definition at line 172 of file AssetViewer.cs.
|
protected |
Current camera distance.
Definition at line 72 of file AssetViewer.cs.
|
staticprotected |
Camera distance ratio based on model bounds.
Definition at line 27 of file AssetViewer.cs.
|
protected |
Current camera pivot position.
Definition at line 77 of file AssetViewer.cs.
|
protected |
Input multiplier based on loaded model bounds.
Definition at line 87 of file AssetViewer.cs.
|
staticprotected |
minimum camera distance.
Definition at line 32 of file AssetViewer.cs.
|
protected |
Skybox game object.
Definition at line 42 of file AssetViewer.cs.
|
staticprotected |
Skybox scale based on model bounds.
Definition at line 37 of file AssetViewer.cs.