Class Page
Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
Page
Assembly: LlamaSoftware.UI.dll
Syntax
[DefaultExecutionOrder(-1)]
[RequireComponent(typeof(Animator), typeof(AudioSource), typeof(CanvasGroup))]
[DisallowMultipleComponent]
public class Page : MonoBehaviour
Fields
animator
Declaration
protected Animator animator
Field Value
| Type |
Description |
| UnityEngine.Animator |
|
audioSource
Declaration
protected AudioSource audioSource
Field Value
| Type |
Description |
| UnityEngine.AudioSource |
|
DISABLE_AUDIO_SOURCE
Declaration
protected const string DISABLE_AUDIO_SOURCE = "DisableAudioSource"
Field Value
| Type |
Description |
| System.String |
|
DisableAudioSourceDelay
Extra delay after EntryClip / ExitClip to disable audio sources.
Setting too low may result in audio artifacts.
Declaration
public float DisableAudioSourceDelay
Field Value
| Type |
Description |
| System.Single |
|
EntryClip
The AudioClip to play when page is coming in. Will not play when entering due to ExitOnNewPagePush.
Declaration
public AudioClip EntryClip
Field Value
| Type |
Description |
| UnityEngine.AudioClip |
|
EntryDirection
The Direction the page should "Enter"
Declaration
public UIAnimationConstants.Direction EntryDirection
Field Value
EntryMode
The Animation mode to use to have the page "Enter"
Declaration
public UIAnimationConstants.EntryMode EntryMode
Field Value
ExitClip
The AudioClip to play when page is exiting. Will not play when exiting due to ExitOnNewPagePush.
Declaration
public AudioClip ExitClip
Field Value
| Type |
Description |
| UnityEngine.AudioClip |
|
ExitDirection
The Direction the page should "Exit"
Declaration
public UIAnimationConstants.Direction ExitDirection
Field Value
ExitMode
The Animation mode to use to have the page "Exit"
Declaration
public UIAnimationConstants.EntryMode ExitMode
Field Value
ExitOnNewPagePush
If true, MenuController will call Exit when a new page is pushed above this, and Enter when this page is on top of the stack again
Declaration
public bool ExitOnNewPagePush
Field Value
| Type |
Description |
| System.Boolean |
|
PostPopAction
Action to call after the page is no longer visible (after Exit animation has completed). You can reset the state of the page here.
Declaration
public UnityEvent PostPopAction
Field Value
| Type |
Description |
| UnityEngine.Events.UnityEvent |
|
PostPushAction
Action to call after page is visible (after Enter animation has completed). You should do things like layout adjustments and selecting objects here.
Declaration
public UnityEvent PostPushAction
Field Value
| Type |
Description |
| UnityEngine.Events.UnityEvent |
|
PrePopAction
Action to call before the page is removed from the screen (before Exit is called). Do not reset the state of the page here because the user can still see this.
Declaration
public UnityEvent PrePopAction
Field Value
| Type |
Description |
| UnityEngine.Events.UnityEvent |
|
PrePushAction
Action to call before pushing a new page (before Enter is called). You should do any required data setup here.
Declaration
public UnityEvent PrePushAction
Field Value
| Type |
Description |
| UnityEngine.Events.UnityEvent |
|
SLIDE_IN_BOTTOM
Declaration
protected const string SLIDE_IN_BOTTOM = "SlideInBottom"
Field Value
| Type |
Description |
| System.String |
|
SLIDE_IN_LEFT
Declaration
protected const string SLIDE_IN_LEFT = "SlideInLeft"
Field Value
| Type |
Description |
| System.String |
|
SLIDE_IN_RIGHT
Declaration
protected const string SLIDE_IN_RIGHT = "SlideInRight"
Field Value
| Type |
Description |
| System.String |
|
SLIDE_IN_TOP
Declaration
protected const string SLIDE_IN_TOP = "SlideInTop"
Field Value
| Type |
Description |
| System.String |
|
SLIDE_OUT_BOTTOM
Declaration
protected const string SLIDE_OUT_BOTTOM = "SlideOutBottom"
Field Value
| Type |
Description |
| System.String |
|
SLIDE_OUT_LEFT
Declaration
protected const string SLIDE_OUT_LEFT = "SlideOutLeft"
Field Value
| Type |
Description |
| System.String |
|
SLIDE_OUT_RIGHT
Declaration
protected const string SLIDE_OUT_RIGHT = "SlideOutRight"
Field Value
| Type |
Description |
| System.String |
|
SLIDE_OUT_TOP
Declaration
protected const string SLIDE_OUT_TOP = "SlideOutTop"
Field Value
| Type |
Description |
| System.String |
|
ZOOM_IN_BOTTOM
Declaration
protected const string ZOOM_IN_BOTTOM = "ZoomInBottom"
Field Value
| Type |
Description |
| System.String |
|
ZOOM_IN_LEFT
Declaration
protected const string ZOOM_IN_LEFT = "ZoomInLeft"
Field Value
| Type |
Description |
| System.String |
|
ZOOM_IN_RIGHT
Declaration
protected const string ZOOM_IN_RIGHT = "ZoomInRight"
Field Value
| Type |
Description |
| System.String |
|
ZOOM_IN_TOP
Declaration
protected const string ZOOM_IN_TOP = "ZoomInTop"
Field Value
| Type |
Description |
| System.String |
|
ZOOM_OUT_BOTTOM
Declaration
protected const string ZOOM_OUT_BOTTOM = "ZoomOutBottom"
Field Value
| Type |
Description |
| System.String |
|
ZOOM_OUT_LEFT
Declaration
protected const string ZOOM_OUT_LEFT = "ZoomOutLeft"
Field Value
| Type |
Description |
| System.String |
|
ZOOM_OUT_RIGHT
Declaration
protected const string ZOOM_OUT_RIGHT = "ZoomOutRight"
Field Value
| Type |
Description |
| System.String |
|
ZOOM_OUT_TOP
Declaration
protected const string ZOOM_OUT_TOP = "ZoomOutTop"
Field Value
| Type |
Description |
| System.String |
|
Methods
Awake()
Setups up internal references to audioSource and animator and disables all UnityEngine.UI.Selectable children.
Declaration
protected virtual void Awake()
CallPostPopAction()
Calls the PostPopAction if bound. Intended to be called by an AnimationEvent
Declaration
public virtual void CallPostPopAction()
CallPostPushAction()
Calls the PostPushAction if bound. Intended to be called by an AnimationEvent
Declaration
public virtual void CallPostPushAction()
DisableAudioSource()
Disables the audio source. This removes the audiosource overhead.
Declaration
public virtual void DisableAudioSource()
Enter(Boolean)
Animates the page in. Calls PrePushAction, then plays animation, then calls PostPushAction
Declaration
public void Enter(bool PlayAudio)
Parameters
| Type |
Name |
Description |
| System.Boolean |
PlayAudio |
If the audio clip should be played
|
Exit(Boolean)
Animates the page out. Calls PrePopAction, then plays animation, then calls PostPopAction
Declaration
public void Exit(bool PlayAudio)
Parameters
| Type |
Name |
Description |
| System.Boolean |
PlayAudio |
|
FadeIn(Boolean)
Declaration
protected virtual void FadeIn(bool PlayAudio)
Parameters
| Type |
Name |
Description |
| System.Boolean |
PlayAudio |
If it should play the EntryClip
|
FadeOut(Boolean)
Declaration
protected virtual void FadeOut(bool PlayAudio)
Parameters
| Type |
Name |
Description |
| System.Boolean |
PlayAudio |
If it should play the ExitClip
|
PlayEntryClip(Boolean)
Declaration
protected virtual void PlayEntryClip(bool PlayAudio)
Parameters
| Type |
Name |
Description |
| System.Boolean |
PlayAudio |
If it should play the EntryClip
|
PlayExitClip(Boolean)
Declaration
protected virtual void PlayExitClip(bool PlayAudio)
Parameters
| Type |
Name |
Description |
| System.Boolean |
PlayAudio |
If it should play the ExitClip
|
SlideIn(Boolean)
Declaration
protected virtual void SlideIn(bool PlayAudio)
Parameters
| Type |
Name |
Description |
| System.Boolean |
PlayAudio |
If it should play the EntryClip
|
SlideOut(Boolean)
Declaration
protected virtual void SlideOut(bool PlayAudio)
Parameters
| Type |
Name |
Description |
| System.Boolean |
PlayAudio |
If it should play the ExitClip
|
Start()
Configures key parts of audioSource in case it's not correct in inspector.
Declaration
protected virtual void Start()
ZoomIn(Boolean)
Declaration
protected virtual void ZoomIn(bool PlayAudio)
Parameters
| Type |
Name |
Description |
| System.Boolean |
PlayAudio |
If it should play the EntryClip
|
ZoomOut(Boolean)
Declaration
protected virtual void ZoomOut(bool PlayAudio)
Parameters
| Type |
Name |
Description |
| System.Boolean |
PlayAudio |
If it should play the ExitClip
|