-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from TheWithz/menu-reconfiguration
Menu reconfiguration
- Loading branch information
Showing
9 changed files
with
9,846 additions
and
4,108 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
OdysseyNow/Assets/Scripts/Graphics/ToggleButtonBehavior.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.SceneManagement; | ||
using UnityEngine.UI; | ||
|
||
namespace Graphics | ||
{ | ||
/// <summary> | ||
/// Behavior of AI toggle buttons and their sliders | ||
/// </summary> | ||
public class ToggleButtonBehavior : MonoBehaviour | ||
{ | ||
// slider to choose AI difficulty | ||
public Slider difficultySlider; | ||
public Text sliderText; | ||
|
||
/// <summary> | ||
/// On start, set button click listener. | ||
/// </summary> | ||
void Start() | ||
{ | ||
gameObject.GetComponent<Toggle>().onValueChanged.AddListener(ToggleClicked); | ||
difficultySlider.onValueChanged.AddListener(value => SliderChanged()); | ||
// hide the sliders parent by default | ||
difficultySlider.transform.parent.gameObject.SetActive(false); | ||
} | ||
|
||
/// <summary> | ||
/// On toggle, hide or show the slider | ||
/// </summary> | ||
void ToggleClicked(bool on) | ||
{ | ||
if(difficultySlider != null && on) { | ||
difficultySlider.transform.parent.gameObject.SetActive(true); | ||
} else if(difficultySlider != null && !on) { | ||
difficultySlider.transform.parent.gameObject.SetActive(false); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// On slider value change, update text to reflect difficulty | ||
/// </summary> | ||
void SliderChanged() | ||
{ | ||
if(sliderText != null) { | ||
sliderText.text = "Difficulty: " + difficultySlider.value; | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
OdysseyNow/Assets/Scripts/Graphics/ToggleButtonBehavior.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,10 +40,17 @@ The following packages were updated: | |
com.unity.purchasing from version 2.0.3 to 2.0.6 | ||
com.unity.textmeshpro from version 1.3.0 to 2.0.1 | ||
|
||
=== Thu Jan 16 13:29:27 2020 | ||
=== Thu Feb 6 14:34:06 2020 | ||
|
||
Packages were changed. | ||
Update Mode: updateDependencies | ||
|
||
The following packages were updated: | ||
com.unity.ide.vscode from version 1.1.0 to 1.1.3 | ||
com.unity.analytics from version 3.3.2 to 3.3.5 | ||
com.unity.ide.rider from version 1.1.0 to 1.1.4 | ||
com.unity.ide.vscode from version 1.1.0 to 1.1.4 | ||
com.unity.multiplayer-hlapi from version 1.0.2 to 1.0.4 | ||
com.unity.test-framework from version 1.0.13 to 1.1.9 | ||
com.unity.timeline from version 1.1.0 to 1.2.10 | ||
The following packages were removed: | ||
[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,35 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!159 &1 | ||
EditorSettings: | ||
m_ObjectHideFlags: 0 | ||
serializedVersion: 7 | ||
m_ExternalVersionControlSupport: Visible Meta Files | ||
m_SerializationMode: 2 | ||
m_LineEndingsForNewScripts: 2 | ||
m_DefaultBehaviorMode: 1 | ||
m_SpritePackerMode: 4 | ||
m_SpritePackerPaddingPower: 1 | ||
m_EtcTextureCompressorBehavior: 1 | ||
m_EtcTextureFastCompressor: 1 | ||
m_EtcTextureNormalCompressor: 2 | ||
m_EtcTextureBestCompressor: 4 | ||
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd | ||
m_ProjectGenerationRootNamespace: | ||
m_UserGeneratedProjectSuffix: | ||
m_CollabEditorSettings: | ||
inProgressEnabled: 1 | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!159 &1 | ||
EditorSettings: | ||
m_ObjectHideFlags: 0 | ||
serializedVersion: 9 | ||
m_ExternalVersionControlSupport: Visible Meta Files | ||
m_SerializationMode: 2 | ||
m_LineEndingsForNewScripts: 2 | ||
m_DefaultBehaviorMode: 1 | ||
m_PrefabRegularEnvironment: {fileID: 0} | ||
m_PrefabUIEnvironment: {fileID: 0} | ||
m_SpritePackerMode: 4 | ||
m_SpritePackerPaddingPower: 1 | ||
m_EtcTextureCompressorBehavior: 1 | ||
m_EtcTextureFastCompressor: 1 | ||
m_EtcTextureNormalCompressor: 2 | ||
m_EtcTextureBestCompressor: 4 | ||
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmref | ||
m_ProjectGenerationRootNamespace: | ||
m_CollabEditorSettings: | ||
inProgressEnabled: 1 | ||
m_EnableTextureStreamingInEditMode: 1 | ||
m_EnableTextureStreamingInPlayMode: 1 | ||
m_AsyncShaderCompilation: 1 | ||
m_EnterPlayModeOptionsEnabled: 0 | ||
m_EnterPlayModeOptions: 3 | ||
m_ShowLightmapResolutionOverlay: 1 | ||
m_UseLegacyProbeSampleCount: 1 | ||
m_AssetPipelineMode: 1 | ||
m_CacheServerMode: 0 | ||
m_CacheServerEndpoint: | ||
m_CacheServerNamespacePrefix: default | ||
m_CacheServerEnableDownload: 1 | ||
m_CacheServerEnableUpload: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
m_EditorVersion: 2019.2.17f1 | ||
m_EditorVersionWithRevision: 2019.2.17f1 (8e603399ca02) | ||
m_EditorVersion: 2019.3.0f6 | ||
m_EditorVersionWithRevision: 2019.3.0f6 (27ab2135bccf) |