浏览代码

Add an on Interaction Ended Event raise

/main
Chema Damak 4 年前
当前提交
1cd68b6d
共有 4 个文件被更改,包括 24 次插入35 次删除
  1. 2
      UOP1_Project/Assets/Prefabs/UI/UIManager.prefab
  2. 29
      UOP1_Project/Assets/Scenes/UI Scene.unity
  3. 20
      UOP1_Project/Assets/Scripts/UI/UIManager.cs
  4. 8
      UOP1_Project/Assets/Inventory/Scripts.meta

2
UOP1_Project/Assets/Prefabs/UI/UIManager.prefab


type: 2}
CloseInventoryScreenEvent: {fileID: 11400000, guid: f6f7aad2f09f04ebf8d89aa6f52a6102,
type: 2}
OnInteractionEndedEvent: {fileID: 11400000, guid: c499d87f35465124f8fb2751b150430d,
type: 2}
SetInteractionEvent: {fileID: 11400000, guid: 818cc55cb05226248bdb15ace58eab84,
type: 2}
dialogueController: {fileID: 0}

29
UOP1_Project/Assets/Scenes/UI Scene.unity


m_Modification:
m_TransformParent: {fileID: 1869732381}
m_Modifications:
- target: {fileID: 1711649698, guid: 42ed5ae1f90714c4488cfabda2298591, type: 3}
propertyPath: m_AnchoredPosition.y
value: -19.999878
objectReference: {fileID: 0}
- target: {fileID: 1575787593219355029, guid: 42ed5ae1f90714c4488cfabda2298591,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: RaiseEvent
objectReference: {fileID: 0}
- target: {fileID: 1575787593498220194, guid: 42ed5ae1f90714c4488cfabda2298591,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: RaiseEvent
objectReference: {fileID: 0}
- target: {fileID: 3371382726859284656, guid: 42ed5ae1f90714c4488cfabda2298591,
type: 3}
propertyPath: m_text
value:
objectReference: {fileID: 0}
- target: {fileID: 5854709384753378033, guid: 42ed5ae1f90714c4488cfabda2298591,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8607855649645135864, guid: 42ed5ae1f90714c4488cfabda2298591,
type: 3}
propertyPath: m_enableAutoSizing
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9125883718042355530, guid: 42ed5ae1f90714c4488cfabda2298591,
type: 3}
propertyPath: m_LocalPosition.x

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


public VoidEventChannelSO OpenInventoryScreenForCookingEvent;
public VoidEventChannelSO CloseInventoryScreenEvent;
public VoidEventChannelSO OnInteractionEndedEvent;
public InteractionUIEventChannelSO SetInteractionEvent;
private void OnEnable()

{
SetInteractionEvent.OnEventRaised += SetInteractionPanel;
}
}
private void Start()

public void SetInventoryScreenForCooking()
{
OpenInventoryScreen(true);
isForCooking = true;
OpenInventoryScreen();
OpenInventoryScreen(false);
isForCooking = false;
OpenInventoryScreen();
void OpenInventoryScreen(bool isForCooking)
bool isForCooking = false;
void OpenInventoryScreen()
{
inventoryPanel.gameObject.SetActive(true);

{
inventoryPanel.gameObject.SetActive(false);
if (isForCooking)
{
OnInteractionEndedEvent.RaiseEvent();
}
}
public void SetInteractionPanel(bool isOpenEvent, InteractionType interactionType)

8
UOP1_Project/Assets/Inventory/Scripts.meta


fileFormatVersion: 2
guid: ae042d26dee93eb4ea906e8b3335ca9d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存