浏览代码

Added Event that takes GameObject in parameter

/main
Amel Negra 4 年前
当前提交
9cca9fad
共有 2 个文件被更改,包括 28 次插入0 次删除
  1. 17
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/GameObjectEventChannelSO.cs
  2. 11
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/GameObjectEventChannelSO.cs.meta

17
UOP1_Project/Assets/Scripts/Events/ScriptableObjects/GameObjectEventChannelSO.cs


using UnityEngine.Events;
using UnityEngine;
/// <summary>
/// This class is used for Events that have one gameobject argument.
/// Example: A game object pick up event event, where the GameObject is the object we are interacting with.
/// </summary>
[CreateAssetMenu(menuName = "Events/GameObject Event Channel")]
public class GameObjectEventChannelSO : ScriptableObject
{
public UnityAction<GameObject> OnEventRaised;
public void RaiseEvent(GameObject value)
{
OnEventRaised.Invoke(value);
}
}

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


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