Google.Cast.RemoteDisplay.UI.CastDefaultUI

The default UI for Cast functionality.

Summary

Handles cast selection, display, starting/ending Cast sessions, basic error display, etc.

Inheritance

Inherits from: MonoBehaviour

Public attributes

castButtonFrame
Container for the start/stop casting button.
castDisconnectDialog
Dialog for disconnecting a cast device.
castListDialog
The selection list UI element.
castUISprites
Outlet for the sprites needed by various Cast UI components.
connectingAnimator
Animator
Outlet for the animator needed by the cast button.
darkMask
GameObject
Dark background when showing dialogs.
enableFirstTimeCastUI = false
bool
Controls the enabling of the default first time cast UI .
errorDialog
Dialog for displaying errors from the Remote Display Manager.
firstTimeCastDialog
Dialog for displaying the "first time cast" information.

Public static functions

GetInstance()
Returns CastDefaultUI singleton.

Public functions

Initialize()
void
Listens to the cast manager notifications, and sets up the start state for the UI .
OnCastButtonTapped()
void
Either stop casting or open the list of detected cast devices.
OnCastDevicesUpdated(CastRemoteDisplayManager manager)
void
When the list of devices updates, update the list.
OnCloseCastList()
void
Callback when the user taps close button.
OnCloseDisconnectDialog()
void
Callback when the user taps close button.
OnConfirmErrorDialog()
void
Called when the error dialog is confirmed.
OnConfirmFirstTimeDialog()
void
Called when the first time dialog is confirmed.
OnConfirmLearnMore()
void
Called when the learn more button is pressed.
OnDisconnectButtonTapped()
void
Called when the disconnect button is pressed.
OnRemoteDisplaySessionEnd(CastRemoteDisplayManager manager)
void
Cleans up display when the session is over.
OnRemoteDisplaySessionStart(CastRemoteDisplayManager manager)
void
Closes the list of devices, sets up the casting display.
ShowFirstTimeCastDialogIfNeeded()
void
Shows the first time cast dialog, if it hasn't yet been shown.
Uninitialize()
void
Unlistens to the cast manager notifications.

Public attributes

castButtonFrame

CastButtonFrame castButtonFrame

Container for the start/stop casting button.

castDisconnectDialog

CastDisconnectDialog castDisconnectDialog

Dialog for disconnecting a cast device.

castListDialog

CastListDialog castListDialog

The selection list UI element.

castUISprites

CastUISprites castUISprites

Outlet for the sprites needed by various Cast UI components.

connectingAnimator

Animator connectingAnimator

Outlet for the animator needed by the cast button.

darkMask

GameObject darkMask

Dark background when showing dialogs.

enableFirstTimeCastUI

bool enableFirstTimeCastUI = false

Controls the enabling of the default first time cast UI .

This will automatically turn on the dialog if a cast device is discovered and the user has not seen it yet.

errorDialog

CastErrorDialog errorDialog

Dialog for displaying errors from the Remote Display Manager.

firstTimeCastDialog

FirstTimeCastDialog firstTimeCastDialog

Dialog for displaying the "first time cast" information.

Public static functions

GetInstance

CastDefaultUI GetInstance()

Returns CastDefaultUI singleton.

There should only be one CastDefaultUI at a time - this allows easy programatic calling of public functionality.

Public functions

Initialize

void Initialize()

Listens to the cast manager notifications, and sets up the start state for the UI .

OnCastButtonTapped

void OnCastButtonTapped()

Either stop casting or open the list of detected cast devices.

OnCastDevicesUpdated

void OnCastDevicesUpdated(
  CastRemoteDisplayManager manager
)

When the list of devices updates, update the list.

Called when the list of devices updates.

OnCloseCastList

void OnCloseCastList()

Callback when the user taps close button.

OnCloseDisconnectDialog

void OnCloseDisconnectDialog()

Callback when the user taps close button.

OnConfirmErrorDialog

void OnConfirmErrorDialog()

Called when the error dialog is confirmed.

OnConfirmFirstTimeDialog

void OnConfirmFirstTimeDialog()

Called when the first time dialog is confirmed.

OnConfirmLearnMore

void OnConfirmLearnMore()

Called when the learn more button is pressed.

OnDisconnectButtonTapped

void OnDisconnectButtonTapped()

Called when the disconnect button is pressed.

OnRemoteDisplaySessionEnd

void OnRemoteDisplaySessionEnd(
  CastRemoteDisplayManager manager
)

Cleans up display when the session is over.

OnRemoteDisplaySessionStart

void OnRemoteDisplaySessionStart(
  CastRemoteDisplayManager manager
)

Closes the list of devices, sets up the casting display.

ShowFirstTimeCastDialogIfNeeded

void ShowFirstTimeCastDialogIfNeeded()

Shows the first time cast dialog, if it hasn't yet been shown.

Uninitialize

void Uninitialize()

Unlistens to the cast manager notifications.