Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Slashlust/slashlust into 49…
Browse files Browse the repository at this point in the history
…-busca-no-grafo
  • Loading branch information
LucasVinicius314 committed Sep 16, 2022
2 parents e4a6d4f + e036ff0 commit b0b680f
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 23 deletions.
4 changes: 2 additions & 2 deletions Assets/Prefabs/Canvas.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Mostrar controles flutuantes
m_Text: Esconder controles flutuantes
--- !u!1 &2932101238255713229
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1469,7 +1469,7 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 2932101238483661020}
m_HandleRect: {fileID: 2932101238483661021}
m_Direction: 2
m_Value: 0
m_Value: 1
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
Expand Down
28 changes: 22 additions & 6 deletions Assets/Scenes/MainScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ Mesh:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh-99654
m_Name: pb_Mesh-4662
serializedVersion: 10
m_SubMeshes:
- serializedVersion: 2
Expand Down Expand Up @@ -887,6 +887,10 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 2932101238006215581, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3}
propertyPath: m_Text
value: Esconder controles flutuantes
objectReference: {fileID: 0}
- target: {fileID: 2932101238026633416, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3}
propertyPath: m_AnchorMax.y
value: 0
Expand Down Expand Up @@ -939,6 +943,10 @@ PrefabInstance:
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2932101238397256823, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3}
propertyPath: m_AnchoredPosition.y
value: -0.000061035156
objectReference: {fileID: 0}
- target: {fileID: 2932101238483661021, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3}
propertyPath: m_AnchorMax.x
value: 0
Expand All @@ -947,6 +955,10 @@ PrefabInstance:
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2932101238483661021, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2932101238917987731, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3}
propertyPath: m_AnchorMax.y
value: 0
Expand All @@ -969,23 +981,23 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 2932101239167418444, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2932101239167418444, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2932101239167418444, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3}
propertyPath: m_SizeDelta.x
value: 0
value: 1399.9999
objectReference: {fileID: 0}
- target: {fileID: 2932101239167418444, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3}
propertyPath: m_SizeDelta.y
value: 0
value: 90.3
objectReference: {fileID: 0}
- target: {fileID: 2932101239167418444, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 699.99994
objectReference: {fileID: 0}
- target: {fileID: 2932101239374365858, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3}
propertyPath: m_Pivot.x
Expand Down Expand Up @@ -1075,6 +1087,10 @@ PrefabInstance:
propertyPath: m_Name
value: Canvas
objectReference: {fileID: 0}
- target: {fileID: 2932101239911592907, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3}
propertyPath: m_AnchoredPosition.y
value: -49.999878
objectReference: {fileID: 0}
- target: {fileID: 2932101240029749903, guid: 3b586217a958dcd42976ca69ca9e3ed3, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
Expand Down
20 changes: 10 additions & 10 deletions Assets/Scripts/MenuScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@

public class MenuScript : MonoBehaviour
{
Toggle? gamepadEnabledToggle;
Toggle? gamepadDisabledToggle;

void SetGamepadEnabled(bool value, Toggle gamepadEnabledToggle)
void SetGamepadEnabled(bool value, Toggle gamepadDisabledToggle)
{
gamepadEnabledToggle.isOn = value;
gamepadDisabledToggle.isOn = value;

if (value)
{
GameManagerScript.instance.EnableGamepad();
GameManagerScript.instance.DisableGamepad();
}
else
{
GameManagerScript.instance.DisableGamepad();
GameManagerScript.instance.EnableGamepad();
}
}

void Awake()
{
gamepadEnabledToggle =
gamepadDisabledToggle =
transform.Find("MenuPanel/Body/ScrollArea/Column/GamepadEnabled/Toggle")
.GetComponent<Toggle>();
}
Expand All @@ -32,13 +32,13 @@ void Start()
{
var gamepadEnabled = LocalPrefs.GetGamepadEnabled();

if (gamepadEnabledToggle != null)
if (gamepadDisabledToggle != null)
{
SetGamepadEnabled(gamepadEnabled, gamepadEnabledToggle);
SetGamepadEnabled(gamepadEnabled, gamepadDisabledToggle);

gamepadEnabledToggle.onValueChanged.AddListener((value) =>
gamepadDisabledToggle.onValueChanged.AddListener((value) =>
{
SetGamepadEnabled(value, gamepadEnabledToggle);
SetGamepadEnabled(value, gamepadDisabledToggle);

LocalPrefs.SetGamepadEnabled(value);
});
Expand Down
10 changes: 5 additions & 5 deletions Assets/Scripts/Utils/LocalPrefs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@

public enum LocalPrefKeys
{
gamepadEnabled,
gamepadDisabled,
}

public static class LocalPrefs
{
public static bool GetGamepadEnabled()
{
return PlayerPrefs.GetInt(
LocalPrefKeys.gamepadEnabled.ToString()
) == 1;
LocalPrefKeys.gamepadDisabled.ToString()
) == 0;
}

public static void SetGamepadEnabled(bool gamepadEnabled)
{
PlayerPrefs.SetInt(
LocalPrefKeys.gamepadEnabled.ToString(),
gamepadEnabled ? 1 : 0
LocalPrefKeys.gamepadDisabled.ToString(),
gamepadEnabled ? 0 : 1
);
}
}

0 comments on commit b0b680f

Please sign in to comment.