浏览代码

Merge remote-tracking branch 'origin/main' into main

/main
Amel Negra 4 年前
当前提交
ac509ab2
共有 4 个文件被更改,包括 21 次插入35 次删除
  1. 23
      UOP1_Project/Assets/Prefabs/UI/ButtonChoice.prefab
  2. 16
      UOP1_Project/Assets/Scripts/UI/UIDialogueChoiceFiller.cs
  3. 9
      UOP1_Project/Assets/Scripts/UI/UIDialogueChoicesManager.cs
  4. 8
      UOP1_Project/Assets/Scripts/UI/UIManager.cs

23
UOP1_Project/Assets/Prefabs/UI/ButtonChoice.prefab


- component: {fileID: 20254460}
- component: {fileID: 20254463}
- component: {fileID: 3600158999093101197}
- component: {fileID: 20254461}
- component: {fileID: 5530593642877575383}
- component: {fileID: 57285731237384622}
m_Layer: 5
m_Name: ButtonToClick
m_TagString: Untagged

m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &20254461
--- !u!114 &57285731237384622
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}

m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Script: {fileID: 11500000, guid: 77b26c7a54d143a7b78bcba222262814, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:

m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1448887160}
m_TargetAssemblyTypeName:
m_TargetAssemblyTypeName: UIDialogueChoiceFiller, Assembly-CSharp
m_MethodName: ButtonClicked
m_Mode: 1
m_Arguments:

m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &5530593642877575383
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 20254459}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 83c0f9e51d2b4ff7bc0b46c5ed82b408, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &550526546634029911
GameObject:
m_ObjectHideFlags: 0

m_EditorClassIdentifier:
_choiceText: {fileID: 550526547636381840}
_makeAChoiceEvent: {fileID: 11400000, guid: f7b40077957f3834a8d5354c3e4ce759, type: 2}
_actionButton: {fileID: 20254461}
_actionButton: {fileID: 57285731237384622}
--- !u!1 &550526547636381838
GameObject:
m_ObjectHideFlags: 0

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


[SerializeField] private LocalizeStringEvent _choiceText = default;
[SerializeField] private DialogueChoiceChannelSO _makeAChoiceEvent = default;
[SerializeField] private Button _actionButton = default;
[SerializeField] private MultiInputButton _actionButton = default;
public void FillChoice(Choice choiceToFill)
public void FillChoice(Choice choiceToFill, bool isSelected)
if(isSelected)
{
_actionButton.Select();
}
if (_makeAChoiceEvent != null)
public void SetSelected()
{
if (_actionButton != null)
_actionButton.Select();
}
}

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


public void FillChoices(List<Choice> choices)
{
if (choices != null)
{
int maxCount = Mathf.Max(choices.Count, listChoiceButtons.Length);

{
if (i < choices.Count)
{
listChoiceButtons[i].FillChoice(choices[i]);
listChoiceButtons[i].FillChoice(choices[i], i==0);
listChoiceButtons[i].gameObject.SetActive(true);
}

}
}
if (choices.Count > 0)
{
listChoiceButtons[0].SetSelected();
}
}

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


{
_onSceneReady.OnEventRaised += ResetUI;
_openUIDialogueEvent.OnEventRaised += OpenUIDialogue;
_closeUIDialogueEvent.OnEventRaised += CloseUIDialogue;
_inputReader.menuPauseEvent += OpenUIPause; // subscription to open Pause UI event happens in OnEnabled, but the close Event is only subscribed to when the popup is open
_openInventoryScreenForCookingEvent.OnEventRaised += SetInventoryScreenForCooking;

_closeUIInventoryEvent.OnEventRaised += CloseInventoryScreen;
}
void ResetUI()

_openInventoryScreenForCookingEvent.OnEventRaised -= SetInventoryScreenForCooking;
_setInteractionEvent.OnEventRaised -= SetInteractionPanel;
_inputReader.openInventoryEvent -= SetInventoryScreen;
_closeUIInventoryEvent.OnEventRaised -= CloseInventoryScreen;
}
void OpenUIPause()

正在加载...
取消
保存