浏览代码

Merge branch 'main' of https://github.com/AlexandreGheraibia/open-project-1 into main

# Conflicts:
#	UOP1_Project/Assets/Prefabs/Characters/Pig/Interaction.prefab
#	UOP1_Project/Assets/Prefabs/Characters/PigChef.prefab
/UI
Ciro Continisio 4 年前
当前提交
b7e86dc9
共有 20 个文件被更改,包括 255 次插入164 次删除
  1. 7
      UOP1_Project/Assets/Art/Characters/PigChef/Animation/PigChef_Collect.fbx.meta
  2. 85
      UOP1_Project/Assets/Prefabs/Characters/PigChef.prefab
  3. 8
      UOP1_Project/Assets/Prefabs/Characters/PlantCritter.prefab
  4. 41
      UOP1_Project/Assets/Prefabs/Characters/SlimeCritter_Base.prefab
  5. 16
      UOP1_Project/Assets/Scenes/WIP/TestingGround.unity
  6. 19
      UOP1_Project/Assets/Scripts/Characters/Critter.cs
  7. 2
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/ClearInputCache_OnEnterSO.cs
  8. 8
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsPickingUpSO.cs
  9. 6
      UOP1_Project/Assets/Scripts/Characters/ZoneTriggerController.cs
  10. 2
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/DialogueEventChannelSo.cs
  11. 2
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/ItemEventChannelSo.cs
  12. 12
      UOP1_Project/Assets/Scripts/Interaction/Interaction.cs
  13. 164
      UOP1_Project/Assets/Scripts/Interaction/InteractionManager.cs
  14. 2
      UOP1_Project/Assets/Scripts/Interaction/InteractionManager.cs.meta
  15. 2
      UOP1_Project/Assets/Scripts/Inventory/InventoryItemFiller.cs
  16. 10
      UOP1_Project/Assets/Scripts/Inventory/InventoryManager.cs
  17. 2
      UOP1_Project/Assets/Scripts/Inventory/ItemPicker.cs
  18. 8
      UOP1_Project/Assets/Scripts/Inventory/UIInventoryManager.cs
  19. 15
      UOP1_Project/Assets/ScriptableObjects/StateMachine/Config/Health1.asset
  20. 8
      UOP1_Project/Assets/ScriptableObjects/StateMachine/Config/Health1.asset.meta

7
UOP1_Project/Assets/Art/Characters/PigChef/Animation/PigChef_Collect.fbx.meta


floatParameter: 0
intParameter: 0
messageOptions: 0
- time: 0.32616487
functionName: Collect
data:
objectReferenceParameter: {instanceID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0
transformMask: []
maskType: 3
maskSource: {instanceID: 0}

85
UOP1_Project/Assets/Prefabs/Characters/PigChef.prefab


_walkingParticles: {fileID: 4559447277278735044}
_landParticles: {fileID: 334012115255375375}
_jumpParticles: {fileID: 4839788363397376542}
--- !u!114 &7131759063303077359
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 309633228405838073}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a40d14d4203a8e14e9cc748b46975252, type: 3}
m_Name:
m_EditorClassIdentifier:
currentInteractionType: 0
_inputReader: {fileID: 11400000, guid: 945ec0365077176418488737deed54be, type: 2}
_onObjectPickUp: {fileID: 11400000, guid: 582b52ca2b84a41528fe274eea1ced6a, type: 2}
_onCookingStart: {fileID: 11400000, guid: 146c579dca5c2f248a607ef66a36d765, type: 2}
_startTalking: {fileID: 11400000, guid: bff3df361fa61684386f84b5b062875a, type: 2}
_toggleInteractionUI: {fileID: 11400000, guid: 818cc55cb05226248bdb15ace58eab84,
type: 2}
_onInteractionEnded: {fileID: 11400000, guid: c499d87f35465124f8fb2751b150430d,
type: 2}
--- !u!1 &648091144661104905
GameObject:
m_ObjectHideFlags: 0

m_Component:
- component: {fileID: 6649678422514028085}
- component: {fileID: 5021713601820606395}
- component: {fileID: 4712659148336435792}
- component: {fileID: 7672995618026100410}
m_Name: Interaction
m_Name: InteractionDetector
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

serializedVersion: 2
m_Size: {x: 0.3, y: 1, z: 1}
m_Center: {x: 0, y: 0.5, z: 0.8}
--- !u!114 &4712659148336435792
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2248731488678348755}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a40d14d4203a8e14e9cc748b46975252, type: 3}
m_Name:
m_EditorClassIdentifier:
currentInteraction: 0
_inputReader: {fileID: 11400000, guid: 945ec0365077176418488737deed54be, type: 2}
_onObjectPickUp: {fileID: 11400000, guid: 582b52ca2b84a41528fe274eea1ced6a, type: 2}
_onCookingStart: {fileID: 11400000, guid: 146c579dca5c2f248a607ef66a36d765, type: 2}
_startTalking: {fileID: 11400000, guid: bff3df361fa61684386f84b5b062875a, type: 2}
_toggleInteractionUI: {fileID: 11400000, guid: 818cc55cb05226248bdb15ace58eab84,
type: 2}
_onInteractionEnded: {fileID: 11400000, guid: c499d87f35465124f8fb2751b150430d,
type: 2}
--- !u!54 &6918309245020967560
Rigidbody:
m_ObjectHideFlags: 0

m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_UseGravity: 0
--- !u!114 &7672995618026100410
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2248731488678348755}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7eb40f37003e762489325a71829af192, type: 3}
m_Name:
m_EditorClassIdentifier:
_enterZone:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 7131759063303077359}
m_MethodName: OnTriggerChangeDetected
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
_layers:
serializedVersion: 2
m_Bits: 4294967295
--- !u!1 &2346068202725057742
GameObject:
m_ObjectHideFlags: 0

type: 3}
m_PrefabInstance: {fileID: 616254372594363816}
m_PrefabAsset: {fileID: 0}
--- !u!4 &5700738674217691736 stripped
--- !u!4 &8291487101514034000 stripped
m_CorrespondingSourceObject: {fileID: 5156753003295213552, guid: c478a391cfbc4b74ebda3f9a57283705,
m_CorrespondingSourceObject: {fileID: -316334440819292424, guid: c478a391cfbc4b74ebda3f9a57283705,
type: 3}
m_PrefabInstance: {fileID: 616254372594363816}
m_PrefabAsset: {fileID: 0}

type: 3}
m_PrefabInstance: {fileID: 616254372594363816}
m_PrefabAsset: {fileID: 0}
--- !u!4 &8291487101514034000 stripped
--- !u!4 &5700738674217691736 stripped
m_CorrespondingSourceObject: {fileID: -316334440819292424, guid: c478a391cfbc4b74ebda3f9a57283705,
m_CorrespondingSourceObject: {fileID: 5156753003295213552, guid: c478a391cfbc4b74ebda3f9a57283705,
type: 3}
m_PrefabInstance: {fileID: 616254372594363816}
m_PrefabAsset: {fileID: 0}

8
UOP1_Project/Assets/Prefabs/Characters/PlantCritter.prefab


m_Script: {fileID: 11500000, guid: d83d74df43f0a0b42afeaffe5c3e02cc, type: 3}
m_Name:
m_EditorClassIdentifier:
_chasingConfigSO: {fileID: 11400000, guid: 31ef964f64f38034aacb40476ff3984a, type: 2}
isPlayerInAlertZone: 0
isPlayerInAttackZone: 0
currentTarget: {fileID: 0}
--- !u!114 &5224987954583862020
MonoBehaviour:
m_ObjectHideFlags: 0

- target: {fileID: 96998187169542721, guid: c823b09b59e206649a8779a78929fa2d,
type: 3}
propertyPath: _enterZone.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: set_isPlayerInAttackZone
value: OnAttackTriggerChange
objectReference: {fileID: 0}
- target: {fileID: 96998187169542726, guid: c823b09b59e206649a8779a78929fa2d,
type: 3}

- target: {fileID: 96998187169542721, guid: c823b09b59e206649a8779a78929fa2d,
type: 3}
propertyPath: _enterZone.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: set_isPlayerInAlertZone
value: OnAlertTriggerChange
objectReference: {fileID: 0}
- target: {fileID: 96998187169542726, guid: c823b09b59e206649a8779a78929fa2d,
type: 3}

41
UOP1_Project/Assets/Prefabs/Characters/SlimeCritter_Base.prefab


m_Script: {fileID: 11500000, guid: d83d74df43f0a0b42afeaffe5c3e02cc, type: 3}
m_Name:
m_EditorClassIdentifier:
isPlayerInAlertZone: 0
isPlayerInAttackZone: 0
currentTarget: {fileID: 0}
--- !u!114 &1842825883340861665
MonoBehaviour:
m_ObjectHideFlags: 0

- target: {fileID: 96998187169542721, guid: c823b09b59e206649a8779a78929fa2d,
type: 3}
propertyPath: _enterZone.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: set_isPlayerInAttackZone
value: OnAttackTriggerChange
objectReference: {fileID: 0}
- target: {fileID: 96998187169542726, guid: c823b09b59e206649a8779a78929fa2d,
type: 3}

- target: {fileID: 96998187169542721, guid: c823b09b59e206649a8779a78929fa2d,
type: 3}
propertyPath: _enterZone.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: set_isPlayerInAlertZone
value: OnAlertTriggerChange
objectReference: {fileID: 0}
- target: {fileID: 96998187169542726, guid: c823b09b59e206649a8779a78929fa2d,
type: 3}

- target: {fileID: -8679921383154817045, guid: 63937395ff7a888419d4b8fe450d3c91,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
value: 3.43
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 63937395ff7a888419d4b8fe450d3c91,
type: 3}

- target: {fileID: -8679921383154817045, guid: 63937395ff7a888419d4b8fe450d3c91,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
value: 0.46
value: 1
value: 0.3033554
value: 0
value: -0
value: 0
value: -0.9528775
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 63937395ff7a888419d4b8fe450d3c91,
type: 3}

- target: {fileID: -8679921383154817045, guid: 63937395ff7a888419d4b8fe450d3c91,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
value: -144.681
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 63937395ff7a888419d4b8fe450d3c91,
type: 3}

propertyPath: m_RootBone
value:
objectReference: {fileID: 6359161719296748449}
- target: {fileID: 1430996729439901540, guid: 63937395ff7a888419d4b8fe450d3c91,
type: 3}
propertyPath: m_AABB.m_Center.x
value: -0.008828759
objectReference: {fileID: 0}
- target: {fileID: 1430996729439901540, guid: 63937395ff7a888419d4b8fe450d3c91,
type: 3}
propertyPath: m_AABB.m_Center.z
value: 0.37773967
objectReference: {fileID: 0}
- target: {fileID: 1430996729439901540, guid: 63937395ff7a888419d4b8fe450d3c91,
type: 3}
propertyPath: m_AABB.m_Extent.x
value: 0.41092247
objectReference: {fileID: 0}
- target: {fileID: 1430996729439901540, guid: 63937395ff7a888419d4b8fe450d3c91,
type: 3}
propertyPath: m_AABB.m_Extent.z
value: 0.4083134
objectReference: {fileID: 0}
- target: {fileID: 5866666021909216657, guid: 63937395ff7a888419d4b8fe450d3c91,
type: 3}
propertyPath: m_Controller

16
UOP1_Project/Assets/Scenes/WIP/TestingGround.unity
文件差异内容过多而无法显示
查看文件

19
UOP1_Project/Assets/Scripts/Characters/Critter.cs


public class Critter : MonoBehaviour
{
public bool isPlayerInAlertZone { get; set; }
public bool isPlayerInAttackZone { get; set; }
[HideInInspector] public bool isPlayerInAlertZone;
[HideInInspector] public bool isPlayerInAttackZone;
[HideInInspector] public GameObject currentTarget;
public void OnAlertTriggerChange(bool entered, GameObject who)
{
isPlayerInAlertZone = entered;
currentTarget = entered ? who : null;
}
public void OnAttackTriggerChange(bool entered, GameObject who)
{
isPlayerInAttackZone = entered;
//No need to set the target. If we did, we would get currentTarget to null even if
//a target exited the Attack zone (inner) but stayed in the Alert zone (outer).
}
}

2
UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/ClearInputCache_OnEnterSO.cs


{
_protagonist.jumpInput = false;
_protagonist.attackInput = false;
_interactionManager.currentInteraction = InteractionType.None;
_interactionManager.currentInteractionType = InteractionType.None;
}
}

8
UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsPickingUpSO.cs


public override void Awake(StateMachine stateMachine)
{
_interactScript = stateMachine.GetComponentInChildren<InteractionManager>();
_interactScript = stateMachine.GetComponent<InteractionManager>();
if (_interactScript.currentInteraction == InteractionType.PickUp)
if (_interactScript.currentInteractionType == InteractionType.PickUp)
// Consume the input
_interactScript.currentInteraction = InteractionType.None;
// Consume it
_interactScript.currentInteractionType = InteractionType.None;
return true;
}

6
UOP1_Project/Assets/Scripts/Characters/ZoneTriggerController.cs


using UnityEngine.Events;
[System.Serializable]
public class BoolEvent : UnityEvent<bool>
public class BoolEvent : UnityEvent<bool, GameObject>
{
}

{
if ((1 << other.gameObject.layer & _layers) != 0)
{
_enterZone.Invoke(true);
_enterZone.Invoke(true, other.gameObject);
}
}

{
_enterZone.Invoke(false);
_enterZone.Invoke(false, other.gameObject);
}
}
}

2
UOP1_Project/Assets/Scripts/Events/ScriptableObjects/DialogueEventChannelSo.cs


/// </summary>
[CreateAssetMenu(menuName = "Events/Dialogue Event Channel")]
public class DialogueEventChannelSo : ScriptableObject
public class DialogueEventChannelSO : ScriptableObject
{
public UnityAction<ActorSO> OnEventRaised;
public void RaiseEvent(ActorSO actor)

2
UOP1_Project/Assets/Scripts/Events/ScriptableObjects/ItemEventChannelSo.cs


/// </summary>
[CreateAssetMenu(menuName = "Events/UI/Item Event Channel")]
public class ItemEventChannelSo : ScriptableObject
public class ItemEventChannelSO : ScriptableObject
{
public UnityAction<Item> OnEventRaised;
public void RaiseEvent(Item item)

12
UOP1_Project/Assets/Scripts/Interaction/Interaction.cs


public class Interaction
{
public static Interaction NONE = new Interaction(InteractionType.None, null);
public InteractionType Type;
public GameObject InteractableObject;
public InteractionType type;
public GameObject interactableObject;
public Interaction(InteractionType type, GameObject obj)
public Interaction(InteractionType t, GameObject obj)
this.Type = type;
this.InteractableObject = obj;
type = t;
interactableObject = obj;
}
}

164
UOP1_Project/Assets/Scripts/Interaction/InteractionManager.cs


public class InteractionManager : MonoBehaviour
{
[HideInInspector] public InteractionType currentInteraction;
[HideInInspector] public InteractionType currentInteractionType; //This is checked by conditions in the StateMachine
private LinkedList<Interaction> _ongoingInteractions = new LinkedList<Interaction>();
private LinkedList<Interaction> _potentialInteractions = new LinkedList<Interaction>();
[SerializeField] private ItemEventChannelSo _onObjectPickUp = default;
[SerializeField] private ItemEventChannelSO _onObjectPickUp = default;
[SerializeField] private DialogueEventChannelSo _startTalking = default;
//UI event
[SerializeField] private DialogueEventChannelSO _startTalking = default;
//Check if the interaction ended
[SerializeField] private VoidEventChannelSO _onInteractionEnded = default;
private void OnEnable()

_onInteractionEnded.OnEventRaised -= OnInteractionEnd;
}
//When the interaction ends, we still want to display the interaction UI if we are still in the trigger zone
void OnInteractionEnd()
// Called mid-way through the AnimationClip of collecting
private void Collect()
_inputReader.EnableGameplayInput();
Interaction onGoingInteraction = _ongoingInteractions.First.Value;
switch (onGoingInteraction.Type)
GameObject itemObject = _potentialInteractions.First.Value.interactableObject;
_potentialInteractions.RemoveFirst();
if (_onObjectPickUp != null)
//we show it after cooking or talking, in case player want to interact again
case InteractionType.Cook:
case InteractionType.Talk:
_toggleInteractionUI.RaiseEvent(true, onGoingInteraction.Type);
Debug.Log("Display interaction UI");
break;
default:
break;
Item currentItem = itemObject.GetComponent<CollectibleItem>().GetItem();
_onObjectPickUp.RaiseEvent(currentItem);
Destroy(itemObject); //TODO: maybe move this destruction in a more general manger, to implement a removal SFX
RequestUpdateUI(false);
void OnInteractionButtonPress()
private void OnInteractionButtonPress()
//remove interaction after press
Interaction onGoingInteraction = _ongoingInteractions.Count > 0 ?
_ongoingInteractions.First.Value : Interaction.NONE;
_toggleInteractionUI.RaiseEvent(false, onGoingInteraction.Type);
switch (onGoingInteraction.Type)
if (_potentialInteractions.Count == 0)
return;
currentInteractionType = _potentialInteractions.First.Value.type;
switch (_potentialInteractions.First.Value.type)
case InteractionType.None:
return;
case InteractionType.PickUp:
GameObject itemObject = onGoingInteraction.InteractableObject;
_ongoingInteractions.RemoveFirst();
if (_onObjectPickUp != null)
{
//raise an event with an item as parameter (to add object to inventory)
Item currentItem = itemObject.GetComponent<CollectibleItem>().GetItem();
_onObjectPickUp.RaiseEvent(currentItem);
//Debug.Log("PickUp event raised");
//set current interaction for state machine
currentInteraction = InteractionType.PickUp;
}
//destroy the GO
Destroy(itemObject);
break;
//Debug.Log("Cooking event raised");
//Change the action map
//set current interaction for state machine
currentInteraction = InteractionType.Cook;
if (_onCookingStart != null)
if (_startTalking != null)
//raise an event with an actor as parameter
//TODO:
//Debug.Log("talk event raised");
//Change the action map
//set current interaction for state machine
currentInteraction = InteractionType.Talk;
default:
break;
//No need to do anything for Pickup type, the StateMachine will transition to the state
//and then the AnimationClip will call Collect()
private void OnTriggerEnter(Collider other)
//Called by the Event on the trigger collider on the child GO called "InteractionDetector"
public void OnTriggerChangeDetected(bool entered, GameObject obj)
{
if (entered)
AddPotentialInteraction(obj);
else
RemovePotentialInteraction(obj);
}
private void AddPotentialInteraction(GameObject obj)
InteractionType ongoingInteractionType = InteractionType.None;
Interaction newPotentialInteraction = new Interaction(InteractionType.None, obj);
if (other.CompareTag("Pickable"))
if (obj.CompareTag("Pickable"))
ongoingInteractionType = InteractionType.PickUp;
//Debug.Log("I triggered a pickable object!");
newPotentialInteraction.type = InteractionType.PickUp;
else if (other.CompareTag("CookingPot"))
else if (obj.CompareTag("CookingPot"))
ongoingInteractionType = InteractionType.Cook;
//Debug.Log("I triggered a cooking pot!");
newPotentialInteraction.type = InteractionType.Cook;
else if (other.CompareTag("NPC"))
else if (obj.CompareTag("NPC"))
ongoingInteractionType = InteractionType.Talk;
//Debug.Log("I triggered an NPC!");
newPotentialInteraction.type = InteractionType.Talk;
if (ongoingInteractionType != InteractionType.None)
if (newPotentialInteraction.type != InteractionType.None)
_ongoingInteractions.AddFirst(new Interaction(ongoingInteractionType, other.gameObject));
DisplayInteractionUI();
_potentialInteractions.AddFirst(newPotentialInteraction);
RequestUpdateUI(true);
private void DisplayInteractionUI()
{
//Raise event to display UI
Interaction onGoingInteraction = _ongoingInteractions.First.Value;
_toggleInteractionUI.RaiseEvent(true, onGoingInteraction.Type);
}
private void OnTriggerExit(Collider other)
private void RemovePotentialInteraction(GameObject obj)
ResetInteraction(other.gameObject);
}
private void ResetInteraction(GameObject obj)
{
LinkedListNode<Interaction> currentNode = _ongoingInteractions.First;
LinkedListNode<Interaction> currentNode = _potentialInteractions.First;
if (currentNode.Value.InteractableObject == obj)
if (currentNode.Value.interactableObject == obj)
_ongoingInteractions.Remove(currentNode);
_potentialInteractions.Remove(currentNode);
if (_ongoingInteractions.Count > 0)
{
_toggleInteractionUI.RaiseEvent(true, _ongoingInteractions.First.Value.Type);
}
RequestUpdateUI(_potentialInteractions.Count > 0);
}
private void RequestUpdateUI(bool visible)
{
if(visible)
_toggleInteractionUI.RaiseEvent(true, _potentialInteractions.First.Value.type);
{
}
private void OnInteractionEnd()
{
switch (currentInteractionType)
{
case InteractionType.Cook:
case InteractionType.Talk:
//We show the UI after cooking or talking, in case player wants to interact again
RequestUpdateUI(true);
break;
_inputReader.EnableGameplayInput();
}
}

2
UOP1_Project/Assets/Scripts/Interaction/InteractionManager.cs.meta


type: 2}
- _onInteractionEnded: {fileID: 11400000, guid: c499d87f35465124f8fb2751b150430d,
type: 2}
- _oninteractResponsed: {fileID: 11400000, guid: cc6333f29e3561040b0420b725091f63,
type: 2}
executionOrder: 0
icon: {instanceID: 0}
userData:

2
UOP1_Project/Assets/Scripts/Inventory/InventoryItemFiller.cs


[SerializeField]
private Button itemButton;
public void SetItem(ItemStack itemStack, bool isSelected, ItemEventChannelSo selectItemEvent)
public void SetItem(ItemStack itemStack, bool isSelected, ItemEventChannelSO selectItemEvent)
{
UnhoverItem();

10
UOP1_Project/Assets/Scripts/Inventory/InventoryManager.cs


private Inventory currentInventory;
[SerializeField]
private ItemEventChannelSo CookRecipeEvent;
private ItemEventChannelSO CookRecipeEvent;
private ItemEventChannelSo UseItemEvent;
private ItemEventChannelSO UseItemEvent;
private ItemEventChannelSo EquipItemEvent;
private ItemEventChannelSO EquipItemEvent;
ItemEventChannelSo AddItemEvent;
ItemEventChannelSO AddItemEvent;
ItemEventChannelSo RemoveItemEvent;
ItemEventChannelSO RemoveItemEvent;
private void OnEnable()
{

2
UOP1_Project/Assets/Scripts/Inventory/ItemPicker.cs


public class ItemPicker : MonoBehaviour
{
[SerializeField] private ItemEventChannelSo _addItemEvent;
[SerializeField] private ItemEventChannelSO _addItemEvent;
public void PickItem(Item item)
{

8
UOP1_Project/Assets/Scripts/Inventory/UIInventoryManager.cs


private List<InventoryItemFiller> instantiatedGameObjects;
public ItemEventChannelSo CookRecipeEvent;
public ItemEventChannelSo UseItemEvent;
public ItemEventChannelSo EquipItemEvent;
public ItemEventChannelSO CookRecipeEvent;
public ItemEventChannelSO UseItemEvent;
public ItemEventChannelSO EquipItemEvent;
public ItemEventChannelSo SelectItemEvent;
public ItemEventChannelSO SelectItemEvent;
public VoidEventChannelSO ActionButtonClicked;

15
UOP1_Project/Assets/ScriptableObjects/StateMachine/Config/Health1.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e005b717defd93a4c81276fd8caab626, type: 3}
m_Name: Health1
m_EditorClassIdentifier:
_maxHealth: 1

8
UOP1_Project/Assets/ScriptableObjects/StateMachine/Config/Health1.asset.meta


fileFormatVersion: 2
guid: 062b13ba884447d4788d6eac536f846e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存