Skip to content

Commit

Permalink
toggle button visibility fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kbegiedza committed Mar 5, 2018
1 parent 7173c87 commit 7a00c36
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ private void OnEnable()

public override void OnInspectorGUI()
{
EditorGUILayout.Space();
DrawToggleButtonSection();
EditorGUILayout.Space();
DrawAdvancedOptions();
Expand All @@ -54,7 +55,9 @@ private void DrawToggleButtonSection()
{
if (defaultChanged)
{
_toggleButton.objectReferenceValue = _script.gameObject.transform.Find("Canvas").Find("DefaultOpenButton").gameObject;
var gameObject = _script.gameObject.transform.Find("Canvas").Find("DefaultOpenButton").gameObject;
gameObject.SetActive(true);
_toggleButton.objectReferenceValue = gameObject;
}

EditorGUI.BeginDisabledGroup(true);
Expand All @@ -67,6 +70,8 @@ private void DrawToggleButtonSection()
{
if (defaultChanged)
{
var gameObject = _script.gameObject.transform.Find("Canvas").Find("DefaultOpenButton").gameObject;
gameObject.SetActive(false);
_toggleButton.objectReferenceValue = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ private void SearchAndSetupComponents()

//add toggle to toggle Button
_toggleButton.onClick.AddListener(ToggleContent);
_toggleButton.gameObject.SetActive(true);

//attach our logger to Unity's event
Application.logMessageReceived += OnLogMessageReceived;
Expand Down
12 changes: 6 additions & 6 deletions Assets/PortableConsole/Prefabs/PortableConsole.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!1 &1307194968871966
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -3212,8 +3212,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -60, y: -82.50003}
m_SizeDelta: {x: 90, y: 100}
m_AnchoredPosition: {x: -60, y: -82.5}
m_SizeDelta: {x: 100, y: 145}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224086741509775768
RectTransform:
Expand Down Expand Up @@ -3247,9 +3247,9 @@ RectTransform:
m_Father: {fileID: 224074541336107896}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -42.5, y: -42.5}
m_AnchorMin: {x: 1, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -42.5, y: 0}
m_SizeDelta: {x: 75, y: 75}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224089972341455008
Expand Down

0 comments on commit 7a00c36

Please sign in to comment.