C# Класс GreatArcStudios.PauseManager

The pause menu manager. You can extend this to make your own. Everything is pretty modular, so creating you own based off of this should be easy. Thanks for downloading and good luck!
Наследование: UnityEngine.MonoBehaviour
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
AaCombo Dropdown
AfCombo Dropdown
AoBool System.Boolean
AoScriptName String
AoToggle Toggle
AudioEffectsSlider Slider
AudioMasterSlider Slider
AudioMusicSlider Slider
AudioPanel UnityEngine.GameObject
AudioPanelAnimator UnityEngine.Animator
CreditsPanel UnityEngine.GameObject
CreditsPanelAnimator UnityEngine.Animator
DefualtSelectedAudio UnityEngine.GameObject
DefualtSelectedCredits UnityEngine.GameObject
DefualtSelectedMain UnityEngine.GameObject
DefualtSelectedVideo UnityEngine.GameObject
DetailDensity float
DofBool System.Boolean
DofScriptName String
DofToggle Toggle
Effects UnityEngine.AudioSource[]
FovSlider Slider
FullscreenToggle Toggle
HardCodeSomeVideoSettings System.Boolean
HighQualTreeSlider Slider
LodBias float[]
MainCam UnityEngine.Camera
MainCamObj UnityEngine.GameObject
MainMenu String
MainPanel UnityEngine.GameObject
Mask UnityEngine.GameObject
MasterTexSlider Slider
ModelQualSlider Slider
Music UnityEngine.AudioSource[]
OtherUiElements UnityEngine.GameObject[]
PauseMenu UnityEngine.UI.Text
PresetLabel UnityEngine.UI.Text
QuitPanelAnimator UnityEngine.Animator
ReadSimpleTerrain UnityEngine.Terrain
ReadTerrain UnityEngine.Terrain
ReadUseSimpleTerrain System.Boolean
RenderDistSlider Slider
ResolutionLabel UnityEngine.UI.Text
ShadowCascadesSlider Slider
ShadowDist float[]
ShadowDistSlider Slider
SimpleTerrain UnityEngine.Terrain
Terrain UnityEngine.Terrain
TerrainDensitySlider Slider
TerrainQualSlider Slider
TimeScale float
TitleTexts UnityEngine.GameObject
UiEventSystem UnityEngine.EventSystems.EventSystem
UseSimpleTerrain System.Boolean
VSyncToggle Toggle
VidPanel UnityEngine.GameObject
VidPanelAnimator UnityEngine.Animator

Private Properties

Свойство Тип Описание
ApplyAudioMain IEnumerator
ApplyVideo IEnumerator
CancelAudioMain IEnumerator
CancelVideoMain IEnumerator
ChangeRes void
CreditsReturnMain IEnumerator
FromPreset void

Открытые методы

Метод Описание
Apply ( ) : void

Apply the video settings

ApplyAudio ( ) : void

The method for changing the applying new audio settings

Audio ( ) : void

Show the audio panel

AudioIn ( ) : void

Play the "audio panel in" animation.

CancelAudio ( ) : void

Cancel the audio setting changes

CancelVideo ( ) : void

Cancel the video setting changes

CreditsIn ( ) : void
CreditsReturn ( ) : void

Return to the main menu from the credits panel

EnableSimpleTerrain ( System.Boolean b ) : void
LastPreset ( ) : void

Set the quality level one level lower. This is done by getting the current quality level, then using QualitySettings.DecreaseLevel(); to decrease the level. The current level variable is set to the new quality setting, and the label is updated.

LastRes ( ) : void

Method for moving to the last resoution in the allRes array. WARNING: This is not finished/buggy.

NextPreset ( ) : void

Set the quality level one level higher. This is done by getting the current quality level, then using QualitySettings.IncreaseLevel(); to increase the level. The current level variable is set to the new quality setting, and the label is updated.

NextRes ( ) : void

Method for moving to the next resoution in the allRes array. WARNING: This is not finished/buggy.

QuitCancel ( ) : void

Cancels quittting by playing an animation.

QuitGame ( ) : void

Method to quit the game. Call methods such as auto saving before qutting here.

QuitOptions ( ) : void

All the methods relating to qutting should be called here.

Restart ( ) : void

Restart the level by loading the loaded level.

Resume ( ) : void

Method to resume the game, so disable the pause menu and re-enable all other ui elements

ReturnToMenu ( ) : void

Loads the main menu scene.

SetFullScreen ( bool b ) : void

Set the game to windowed or full screen. This is meant to be used with a checkbox

SetGraphicsPreset ( int preset ) : void

Sets the Graphic to a Preset (from very low to extreme) (note: UI buttons in the inspector can carry a parameter, so you wont need 7 methods)

SetLodBias ( float loDBias ) : void

Change the lod bias using QualitySettings.lodBias = LoDBias / 2.15f; LoDBias is only divided by 2.15 because the max is set to 10 on the slider, and dividing by 2.15 results in 4.65, our desired max. However, deleting or changing 2.15 is compeletly fine.

SetMsaaLevel ( int level ) : void

Sets the MSAA to a specific level (between 0 and 4)

Start ( ) : void

The start method; you will need to place all of your inital value getting/setting here.

ToggleAo ( bool b ) : void

Toggle on or off Ambient Occulusion. This is meant to be used with a checkbox.

ToggleDof ( bool b ) : void

Toggle on or off Depth of Field. This is meant to be used with a checkbox.

TreeMaxLod ( float qual ) : void

Change the max amount of high quality trees using terrain.treeMaximumFullLODCount = (int)qual;

TurnOnVSync ( bool b ) : void
Update ( ) : void

The update method. This mainly searches for the user pressing the escape key.

UpdateAniso ( int anisoSetting ) : void

The method for changing aniso settings

UpdateCascades ( float cascades ) : void

The method for setting the amount of shadow cascades

UpdateDensity ( float density ) : void

Update terrain density

UpdateEffectsVol ( float f ) : void

Update the audio effects volume

UpdateFov ( float fov ) : void

Change the fov using a float. The defualt should be 60.

UpdateMasterVol ( float f ) : void

Audio Option Methods

UpdateMusicVol ( float f ) : void

Update music effects volume

UpdateRenderDist ( float f ) : void

Update the render distance using mainCam.farClipPlane = f;

UpdateShadowDistance ( float dist ) : void

Update the shadow distance using QualitySettings.shadowDistance = dist;

UpdateTerrainLod ( float qual ) : void

Change the height map max LOD using terrain.heightmapMaximumLOD = (int)qual;

UpdateTex ( float qual ) : void

Update the texture quality using QualitySettings.masterTextureLimit

UpdateTreeMeshAmt ( int f ) : void

Update full high quality tree mesh amount.

Video ( ) : void

Show video

VideoIn ( ) : void

Play the "video panel in" animation

Приватные методы

Метод Описание
ApplyAudioMain ( ) : IEnumerator

Use an IEnumerator to first play the animation and then change the audio settings

ApplyVideo ( ) : IEnumerator

Use an IEnumerator to first play the animation and then change the video settings.

CancelAudioMain ( ) : IEnumerator

Use an IEnumerator to first play the animation and then change the audio settings

CancelVideoMain ( ) : IEnumerator

Use an IEnumerator to first play the animation and then changethe video settings

ChangeRes ( int index ) : void
CreditsReturnMain ( ) : IEnumerator

Use an IEnumerator to first play the animation and then hide other panels settings

FromPreset ( ) : void

Описание методов

Apply() публичный Метод

Apply the video settings
public Apply ( ) : void
Результат void

ApplyAudio() публичный Метод

The method for changing the applying new audio settings
public ApplyAudio ( ) : void
Результат void

Audio() публичный Метод

Show the audio panel
public Audio ( ) : void
Результат void

AudioIn() публичный Метод

Play the "audio panel in" animation.
public AudioIn ( ) : void
Результат void

CancelAudio() публичный Метод

Cancel the audio setting changes
public CancelAudio ( ) : void
Результат void

CancelVideo() публичный Метод

Cancel the video setting changes
public CancelVideo ( ) : void
Результат void

CreditsIn() публичный Метод

public CreditsIn ( ) : void
Результат void

CreditsReturn() публичный Метод

Return to the main menu from the credits panel
public CreditsReturn ( ) : void
Результат void

EnableSimpleTerrain() публичный Метод

public EnableSimpleTerrain ( System.Boolean b ) : void
b System.Boolean
Результат void

LastPreset() публичный Метод

Set the quality level one level lower. This is done by getting the current quality level, then using QualitySettings.DecreaseLevel(); to decrease the level. The current level variable is set to the new quality setting, and the label is updated.
public LastPreset ( ) : void
Результат void

LastRes() публичный Метод

Method for moving to the last resoution in the allRes array. WARNING: This is not finished/buggy.
public LastRes ( ) : void
Результат void

NextPreset() публичный Метод

Set the quality level one level higher. This is done by getting the current quality level, then using QualitySettings.IncreaseLevel(); to increase the level. The current level variable is set to the new quality setting, and the label is updated.
public NextPreset ( ) : void
Результат void

NextRes() публичный Метод

Method for moving to the next resoution in the allRes array. WARNING: This is not finished/buggy.
public NextRes ( ) : void
Результат void

QuitCancel() публичный Метод

Cancels quittting by playing an animation.
public QuitCancel ( ) : void
Результат void

QuitGame() публичный Метод

Method to quit the game. Call methods such as auto saving before qutting here.
public QuitGame ( ) : void
Результат void

QuitOptions() публичный Метод

All the methods relating to qutting should be called here.
public QuitOptions ( ) : void
Результат void

Restart() публичный Метод

Restart the level by loading the loaded level.
public Restart ( ) : void
Результат void

Resume() публичный Метод

Method to resume the game, so disable the pause menu and re-enable all other ui elements
public Resume ( ) : void
Результат void

ReturnToMenu() публичный Метод

Loads the main menu scene.
public ReturnToMenu ( ) : void
Результат void

SetFullScreen() публичный Метод

Set the game to windowed or full screen. This is meant to be used with a checkbox
public SetFullScreen ( bool b ) : void
b bool
Результат void

SetGraphicsPreset() публичный Метод

Sets the Graphic to a Preset (from very low to extreme) (note: UI buttons in the inspector can carry a parameter, so you wont need 7 methods)
public SetGraphicsPreset ( int preset ) : void
preset int
Результат void

SetLodBias() публичный Метод

Change the lod bias using QualitySettings.lodBias = LoDBias / 2.15f; LoDBias is only divided by 2.15 because the max is set to 10 on the slider, and dividing by 2.15 results in 4.65, our desired max. However, deleting or changing 2.15 is compeletly fine.
public SetLodBias ( float loDBias ) : void
loDBias float
Результат void

SetMsaaLevel() публичный Метод

Sets the MSAA to a specific level (between 0 and 4)
public SetMsaaLevel ( int level ) : void
level int log2 of the desired level. /// 0 -> 0x MSAA (disabled). /// 1 -> 2x MSAA. /// 2 -> 4x MSAA. /// 3 -> 8x MSAA. ///
Результат void

Start() публичный Метод

The start method; you will need to place all of your inital value getting/setting here.
public Start ( ) : void
Результат void

ToggleAo() публичный Метод

Toggle on or off Ambient Occulusion. This is meant to be used with a checkbox.
public ToggleAo ( bool b ) : void
b bool
Результат void

ToggleDof() публичный Метод

Toggle on or off Depth of Field. This is meant to be used with a checkbox.
public ToggleDof ( bool b ) : void
b bool
Результат void

TreeMaxLod() публичный Метод

Change the max amount of high quality trees using terrain.treeMaximumFullLODCount = (int)qual;
public TreeMaxLod ( float qual ) : void
qual float
Результат void

TurnOnVSync() публичный Метод

public TurnOnVSync ( bool b ) : void
b bool
Результат void

Update() публичный Метод

The update method. This mainly searches for the user pressing the escape key.
public Update ( ) : void
Результат void

UpdateAniso() публичный Метод

The method for changing aniso settings
public UpdateAniso ( int anisoSetting ) : void
anisoSetting int
Результат void

UpdateCascades() публичный Метод

The method for setting the amount of shadow cascades
public UpdateCascades ( float cascades ) : void
cascades float
Результат void

UpdateDensity() публичный Метод

Update terrain density
public UpdateDensity ( float density ) : void
density float
Результат void

UpdateEffectsVol() публичный Метод

Update the audio effects volume
public UpdateEffectsVol ( float f ) : void
f float
Результат void

UpdateFov() публичный Метод

Change the fov using a float. The defualt should be 60.
public UpdateFov ( float fov ) : void
fov float
Результат void

UpdateMasterVol() публичный Метод

Audio Option Methods
public UpdateMasterVol ( float f ) : void
f float
Результат void

UpdateMusicVol() публичный Метод

Update music effects volume
public UpdateMusicVol ( float f ) : void
f float
Результат void

UpdateRenderDist() публичный Метод

Update the render distance using mainCam.farClipPlane = f;
public UpdateRenderDist ( float f ) : void
f float
Результат void

UpdateShadowDistance() публичный Метод

Update the shadow distance using QualitySettings.shadowDistance = dist;
public UpdateShadowDistance ( float dist ) : void
dist float
Результат void

UpdateTerrainLod() публичный Метод

Change the height map max LOD using terrain.heightmapMaximumLOD = (int)qual;
public UpdateTerrainLod ( float qual ) : void
qual float
Результат void

UpdateTex() публичный Метод

Update the texture quality using QualitySettings.masterTextureLimit
public UpdateTex ( float qual ) : void
qual float
Результат void

UpdateTreeMeshAmt() публичный Метод

Update full high quality tree mesh amount.
public UpdateTreeMeshAmt ( int f ) : void
f int
Результат void

Video() публичный Метод

Show video
public Video ( ) : void
Результат void

VideoIn() публичный Метод

Play the "video panel in" animation
public VideoIn ( ) : void
Результат void

Описание свойств

AaCombo публичное свойство

AA drop down menu.
public Dropdown AaCombo
Результат Dropdown

AfCombo публичное свойство

Aniso drop down menu.
public Dropdown AfCombo
Результат Dropdown

AoBool публичное статическое свойство

public static Boolean,System AoBool
Результат System.Boolean

AoScriptName публичное свойство

The Ambient Occlusion script name, ie: "AmbientOcclusion". You can leave this blank in the editor, but will throw a null refrence exception, which is harmless.
public String AoScriptName
Результат String

AoToggle публичное свойство

public Toggle AoToggle
Результат Toggle

AudioEffectsSlider публичное свойство

public Slider AudioEffectsSlider
Результат Slider

AudioMasterSlider публичное свойство

public Slider AudioMasterSlider
Результат Slider

AudioMusicSlider публичное свойство

public Slider AudioMusicSlider
Результат Slider

AudioPanel публичное свойство

This is the audio panel holder, which holds all of the silders for the audio panel and should be called "audio panel"
public GameObject,UnityEngine AudioPanel
Результат UnityEngine.GameObject

AudioPanelAnimator публичное свойство

Audio Panel animator
public Animator,UnityEngine AudioPanelAnimator
Результат UnityEngine.Animator

CreditsPanel публичное свойство

This is the credits panel holder, which holds all of the silders for the audio panel and should be called "credits panel"
public GameObject,UnityEngine CreditsPanel
Результат UnityEngine.GameObject

CreditsPanelAnimator публичное свойство

Credits Panel animator
public Animator,UnityEngine CreditsPanelAnimator
Результат UnityEngine.Animator

DefualtSelectedAudio публичное свойство

Defualt selected on the video panel
public GameObject,UnityEngine DefualtSelectedAudio
Результат UnityEngine.GameObject

DefualtSelectedCredits публичное свойство

public GameObject,UnityEngine DefualtSelectedCredits
Результат UnityEngine.GameObject

DefualtSelectedMain публичное свойство

Defualt selected on the video panel
public GameObject,UnityEngine DefualtSelectedMain
Результат UnityEngine.GameObject

DefualtSelectedVideo публичное свойство

Defualt selected on the video panel
public GameObject,UnityEngine DefualtSelectedVideo
Результат UnityEngine.GameObject

DetailDensity публичное свойство

The terrain detail density float. It's only public because you may want to adjust it in editor
public float DetailDensity
Результат float

DofBool публичное статическое свойство

public static Boolean,System DofBool
Результат System.Boolean

DofScriptName публичное свойство

The Depth of Field script name, ie: "DepthOfField". You can leave this blank in the editor, but will throw a null refrence exception, which is harmless.
public String DofScriptName
Результат String

DofToggle публичное свойство

public Toggle DofToggle
Результат Toggle

Effects публичное свойство

An array of sound effect audio sources
public AudioSource[],UnityEngine Effects
Результат UnityEngine.AudioSource[]

FovSlider публичное свойство

public Slider FovSlider
Результат Slider

FullscreenToggle публичное свойство

public Toggle FullscreenToggle
Результат Toggle

HardCodeSomeVideoSettings публичное свойство

Editor boolean for hardcoding certain video settings. It will allow you to use the values defined in LOD Bias and Shadow Distance
public Boolean,System HardCodeSomeVideoSettings
Результат System.Boolean

HighQualTreeSlider публичное свойство

public Slider HighQualTreeSlider
Результат Slider

LodBias публичное свойство

Lod bias float array. You should manually assign these based on the quality level.
public float[] LodBias
Результат float[]

MainCam публичное свойство

The main camera, assign this through the editor.
public Camera,UnityEngine MainCam
Результат UnityEngine.Camera

MainCamObj публичное свойство

The main camera game object, assign this through the editor.
public GameObject,UnityEngine MainCamObj
Результат UnityEngine.GameObject

MainMenu публичное свойство

Main menu level string used for loading the main menu. This means you'll need to type in the editor text box, the name of the main menu level, ie: "mainmenu";
public String MainMenu
Результат String

MainPanel публичное свойство

This is the main panel holder, which holds the main panel and should be called "main panel"
public GameObject,UnityEngine MainPanel
Результат UnityEngine.GameObject

Mask публичное свойство

The mask that makes the scene darker
public GameObject,UnityEngine Mask
Результат UnityEngine.GameObject

MasterTexSlider публичное свойство

public Slider MasterTexSlider
Результат Slider

ModelQualSlider публичное свойство

public Slider ModelQualSlider
Результат Slider

Music публичное свойство

An array of music audio sources
public AudioSource[],UnityEngine Music
Результат UnityEngine.AudioSource[]

OtherUiElements публичное свойство

An array of the other UI elements, which is used for disabling the other elements when the game is paused.
public GameObject[],UnityEngine OtherUiElements
Результат UnityEngine.GameObject[]

PauseMenu публичное свойство

Pause menu text
public Text,UnityEngine.UI PauseMenu
Результат UnityEngine.UI.Text

PresetLabel публичное свойство

The preset text label.
public Text,UnityEngine.UI PresetLabel
Результат UnityEngine.UI.Text

QuitPanelAnimator публичное свойство

Quit Panel animator
public Animator,UnityEngine QuitPanelAnimator
Результат UnityEngine.Animator

ReadSimpleTerrain публичное статическое свойство

public static Terrain,UnityEngine ReadSimpleTerrain
Результат UnityEngine.Terrain

ReadTerrain публичное статическое свойство

public static Terrain,UnityEngine ReadTerrain
Результат UnityEngine.Terrain

ReadUseSimpleTerrain публичное статическое свойство

public static Boolean,System ReadUseSimpleTerrain
Результат System.Boolean

RenderDistSlider публичное свойство

public Slider RenderDistSlider
Результат Slider

ResolutionLabel публичное свойство

Resolution text label.
public Text,UnityEngine.UI ResolutionLabel
Результат UnityEngine.UI.Text

ShadowCascadesSlider публичное свойство

public Slider ShadowCascadesSlider
Результат Slider

ShadowDist публичное свойство

Shadow distance array. You should manually assign these based on the quality level.
public float[] ShadowDist
Результат float[]

ShadowDistSlider публичное свойство

public Slider ShadowDistSlider
Результат Slider

SimpleTerrain публичное свойство

Other terrain variable used if you want to have an option to target low end harware.
public Terrain,UnityEngine SimpleTerrain
Результат UnityEngine.Terrain

Terrain публичное свойство

One terrain variable used if you have a terrain plugin like rtp.
public Terrain,UnityEngine Terrain
Результат UnityEngine.Terrain

TerrainDensitySlider публичное свойство

public Slider TerrainDensitySlider
Результат Slider

TerrainQualSlider публичное свойство

public Slider TerrainQualSlider
Результат Slider

TimeScale публичное свойство

Timescale value. The defualt is 1 for most games. You may want to change it if you are pausing the game in a slow motion situation
public float TimeScale
Результат float

TitleTexts публичное свойство

These are the game objects with the title texts like "Pause menu" and "Game Title"
public GameObject,UnityEngine TitleTexts
Результат UnityEngine.GameObject

UiEventSystem публичное свойство

Event system
public EventSystem,UnityEngine.EventSystems UiEventSystem
Результат UnityEngine.EventSystems.EventSystem

UseSimpleTerrain публичное свойство

Boolean for turning on simple terrain
public Boolean,System UseSimpleTerrain
Результат System.Boolean

VSyncToggle публичное свойство

public Toggle VSyncToggle
Результат Toggle

VidPanel публичное свойство

This is the video panel holder, which holds all of the controls for the video panel and should be called "vid panel"
public GameObject,UnityEngine VidPanel
Результат UnityEngine.GameObject

VidPanelAnimator публичное свойство

Video Panel animator
public Animator,UnityEngine VidPanelAnimator
Результат UnityEngine.Animator