Smart Gallery v1.1
 
Loading...
Searching...
No Matches
Viewer Class Reference

Provides functionality for navigating through frames, accessing properties of frames, and interacting with modules. It also handles the initialization and destruction of the viewer. More...

Inherits MonoBehaviour.

Public Member Functions

void Close ()
 Closes the viewer.
 
void Destroy ()
 Destroys the viewer.
 
IEnumerable< PropertyGetAvailableProperties (bool updateModules=true)
 Retrieves all available properties from the modules.
 
void Initialize (Loader loader)
 Initializes the viewer with the specified loader.
 
void NextFrame ()
 Switches to the next frame in the gallery. If the current frame is the last one and the gallery is set to loop, it will switch back to the first frame. If the gallery is not set to loop, it will stay on the last frame.
 
void PreviousFrame ()
 Switches to the previous frame in the gallery. If the current frame is the first one and the gallery is set to loop, it will switch to the last frame. If the gallery is not set to loop, it will stay on the first frame.
 
void ReloadModules ()
 Causes modules to reload, e.g. the list or contents of frames have been changed.
 
void SetFrame (int index)
 Sets the frame at the specified index.
 

Static Public Member Functions

static Viewer Show (Loader loader)
 Shows the viewer with the specified loader.
 
static Viewer Show (GameObject prefab, RectTransform container, Frames frames, int frameIndex=0)
 Shows the viewer with the specified frames.
 

Static Public Attributes

const string Version = "1.0.0.1"
 The version of the Smart Gallery.
 

Properties

Frame currentFrame [get]
 Gets the current frame.
 
int currentFrameIndex [get]
 Gets the index of the current frame.
 
Frames frames [get]
 Gets all frames.
 
InteractionLocker interactionLocker [get]
 Gets the interaction locker.
 
bool hasNextFrame [get]
 Gets a value indicating whether there is a next frame.
 
bool hasPreviousFrame [get]
 Gets a value indicating whether there is a previous frame.
 
MessageSystem messageSystem [get]
 Gets the message system.
 
int totalFrames [get]
 Gets the total number of frames.
 

Events

static Action< ViewerViewerInitialized
 Occurs when any Viewer is initialized.
 
Action Initialized
 Occurs when the Viewer is initialized.
 

Detailed Description

Provides functionality for navigating through frames, accessing properties of frames, and interacting with modules. It also handles the initialization and destruction of the viewer.

Member Function Documentation

◆ GetAvailableProperties()

IEnumerable< Property > GetAvailableProperties ( bool updateModules = true)

Retrieves all available properties from the modules.

Parameters
updateModulesIndicates whether to update the modules.
Returns
An IEnumerable of Property objects, representing the available properties from the modules. The properties are ordered by their weight and duplicates are removed.

◆ Initialize()

void Initialize ( Loader loader)

Initializes the viewer with the specified loader.

Parameters
loaderThe loader.

◆ SetFrame()

void SetFrame ( int index)

Sets the frame at the specified index.

Parameters
indexThe index of the frame.

◆ Show() [1/2]

static Viewer Show ( GameObject prefab,
RectTransform container,
Frames frames,
int frameIndex = 0 )
static

Shows the viewer with the specified frames.

Parameters
prefabThe viewer prefab.
containerThe container.
framesThe frames.
frameIndexThe index of the frame.
Returns

◆ Show() [2/2]

static Viewer Show ( Loader loader)
static

Shows the viewer with the specified loader.

Parameters
loaderThe loader.
Returns
The viewer.