浏览代码

Added item event type

/main
Amel 4 年前
当前提交
ae316a87
共有 2 个文件被更改,包括 30 次插入0 次删除
  1. 19
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/ItemEventChannelSo.cs
  2. 11
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/ItemEventChannelSo.cs.meta

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


using UnityEngine.Events;
using UnityEngine;
/// <summary>
/// This class is used for Item interaction events.
/// Example: Pick up an item passed as paramater
/// </summary>
[CreateAssetMenu(menuName = "Events/Dialogue Event Channel")]
public class ItemEventChannelSo : ScriptableObject
{
public UnityAction<Item> OnEventRaised;
public void RaiseEvent(Item item)
{
if (OnEventRaised != null)
OnEventRaised.Invoke(item);
}
}

11
UOP1_Project/Assets/Scripts/Events/ScriptableObjects/ItemEventChannelSo.cs.meta


fileFormatVersion: 2
guid: 27ee1f4193e7cac488aad6442034451d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存