浏览代码

Fixing bug in Button selection (Confirmation Popup)

/main
uChema 4 年前
当前提交
46aad295
共有 8 个文件被更改,包括 42 次插入26 次删除
  1. 36
      UOP1_Project/Assets/Prefabs/UI/Popup/Confirmation_Popup.prefab
  2. 2
      UOP1_Project/Assets/Prefabs/UI/Popup/PopupButton.prefab
  3. 3
      UOP1_Project/Assets/Scripts/Menu/MenuSelectionHandler.cs
  4. 5
      UOP1_Project/Assets/Scripts/Menu/MultiInputButton.cs
  5. 4
      UOP1_Project/Assets/Scripts/UI/UIButtonSetter.cs
  6. 9
      UOP1_Project/Assets/Scripts/UI/UIDialogueChoiceFiller.cs
  7. 6
      UOP1_Project/Assets/Scripts/UI/UIManager.cs
  8. 3
      UOP1_Project/Assets/Scripts/UI/UIPopupButtonSetter.cs

36
UOP1_Project/Assets/Prefabs/UI/Popup/Confirmation_Popup.prefab


type: 3}
propertyPath: m_Navigation.m_SelectOnRight
value:
objectReference: {fileID: 5931516840387701227}
objectReference: {fileID: 0}
- target: {fileID: 297632141197697312, guid: 344bb0b18b7db4b4e8874973eb391ca1,
type: 3}
propertyPath: m_Name

propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7373103914063609958, guid: 344bb0b18b7db4b4e8874973eb391ca1,
type: 3}
propertyPath: m_Navigation.m_Mode
value: 4
objectReference: {fileID: 0}
- target: {fileID: 7373103914063609958, guid: 344bb0b18b7db4b4e8874973eb391ca1,
type: 3}
propertyPath: m_Navigation.m_SelectOnRight
value:
objectReference: {fileID: 3999416306740657415}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 344bb0b18b7db4b4e8874973eb391ca1, type: 3}
--- !u!224 &1305894367536927133 stripped

m_Script: {fileID: 11500000, guid: d21c5d8dcb2bf4a9a9adc2d2b723cfa6, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1566308155770987574 stripped
--- !u!114 &8101017140907667674 stripped
m_CorrespondingSourceObject: {fileID: 252969180845692042, guid: 344bb0b18b7db4b4e8874973eb391ca1,
m_CorrespondingSourceObject: {fileID: 7373103914063609958, guid: 344bb0b18b7db4b4e8874973eb391ca1,
type: 3}
m_PrefabInstance: {fileID: 1602752435333050556}
m_PrefabAsset: {fileID: 0}

m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Script: {fileID: 11500000, guid: 77b26c7a54d143a7b78bcba222262814, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &5895846343219592545

type: 3}
propertyPath: m_Navigation.m_SelectOnLeft
value:
objectReference: {fileID: 1566308155770987574}
objectReference: {fileID: 0}
- target: {fileID: 297632141197697312, guid: 344bb0b18b7db4b4e8874973eb391ca1,
type: 3}
propertyPath: m_Name

propertyPath: _currentType
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7373103914063609958, guid: 344bb0b18b7db4b4e8874973eb391ca1,
type: 3}
propertyPath: m_Navigation.m_Mode
value: 4
objectReference: {fileID: 0}
- target: {fileID: 7373103914063609958, guid: 344bb0b18b7db4b4e8874973eb391ca1,
type: 3}
propertyPath: m_Navigation.m_SelectOnLeft
value:
objectReference: {fileID: 8101017140907667674}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 344bb0b18b7db4b4e8874973eb391ca1, type: 3}
--- !u!224 &6193337729689869376 stripped

m_Script: {fileID: 11500000, guid: d21c5d8dcb2bf4a9a9adc2d2b723cfa6, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &5931516840387701227 stripped
--- !u!114 &3999416306740657415 stripped
m_CorrespondingSourceObject: {fileID: 252969180845692042, guid: 344bb0b18b7db4b4e8874973eb391ca1,
m_CorrespondingSourceObject: {fileID: 7373103914063609958, guid: 344bb0b18b7db4b4e8874973eb391ca1,
type: 3}
m_PrefabInstance: {fileID: 5895846343219592545}
m_PrefabAsset: {fileID: 0}

m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Script: {fileID: 11500000, guid: 77b26c7a54d143a7b78bcba222262814, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &6177104811887306383

2
UOP1_Project/Assets/Prefabs/UI/Popup/PopupButton.prefab


m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_Mode: 1
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}

3
UOP1_Project/Assets/Scripts/Menu/MenuSelectionHandler.cs


yield return new WaitForSeconds(.03f); // Necessary wait otherwise the highlight won't show up
if (_defaultSelection != null)
EventSystem.current.SetSelectedGameObject(_defaultSelection);
UpdateSelection(_defaultSelection);
Debug.Log("Unselect");
currentSelection = null;
EventSystem.current.SetSelectedGameObject(null);
}

5
UOP1_Project/Assets/Scripts/Menu/MultiInputButton.cs


_menuSelectionHandler.UpdateSelection(gameObject);
base.OnSelect(eventData);
}
public void UpdateDefault()
public void UpdateSelected()
Debug.Log("Select");
_menuSelectionHandler.UpdateSelection(gameObject);
_menuSelectionHandler.UpdateSelection(gameObject);
}

4
UOP1_Project/Assets/Scripts/UI/UIButtonSetter.cs


{
_buttonClickedEvent = buttonEvent;
if (select)
_button.UpdateDefault();
_button.UpdateSelected();
_button.UpdateDefault();
_button.UpdateSelected();
}
public void Click()

9
UOP1_Project/Assets/Scripts/UI/UIDialogueChoiceFiller.cs


_actionButton.interactable = true;
if (isSelected)
{
Debug.Log("Select");
_actionButton.UpdateDefault();
_actionButton.UpdateSelected();
else
{
Debug.Log("Not selected");
}
}
public void ButtonClicked()

6
UOP1_Project/Assets/Scripts/UI/UIManager.cs


_inputReader.menuCloseEvent -= HideBackToMenuConfirmationPopup;
_closePopupEvent.OnEventRaised -= HideBackToMenuConfirmationPopup;
_pauseScreen.gameObject.SetActive(true); // Set pause screen to inactive
_clickUnpauseEvent.OnEventRaised += CloseUIPause; // unsub from clause pause popup since it's inactive
_selectionHandler.Unselect();
_pauseScreen.gameObject.SetActive(true); // Set pause screen to inactive
_clickUnpauseEvent.OnEventRaised += CloseUIPause; // unsub from clause pause popup since it's inactive
// time is still set to 0 and Input is still set to menuInput
//going out from confirmaiton popup screen gets us back to the pause screen

3
UOP1_Project/Assets/Scripts/UI/UIPopupButtonSetter.cs


void SelectButton()
{
_button.UpdateDefault();
_button.Select();
_button.UpdateSelected();
}
public void ButtonClicked()

正在加载...
取消
保存