浏览代码

Refactored Terminology : Hook > Event

/main
Thomas ICHÉ 5 年前
当前提交
4ef97283
共有 34 个文件被更改,包括 100 次插入88 次删除
  1. 30
      Editor/HiearchyItems.cs
  2. 4
      Editor/SceneLogicEditor/SceneLogicEditor.cs
  3. 4
      Runtime/Events/OnButtonDownEvent.cs
  4. 4
      Runtime/Events/OnEnableDisableEvent.cs
  5. 4
      Runtime/Events/OnKeyDownEvent.cs
  6. 4
      Runtime/Events/OnMessageEvent.cs
  7. 4
      Runtime/Events/OnPickupEvent.cs
  8. 4
      Runtime/Events/OnTriggerEvent.cs
  9. 11
      Runtime/Events/EventBase.cs
  10. 18
      Runtime/Events/OnAwakeEvent.cs
  11. 19
      Runtime/Events/OnDestroyEvent.cs
  12. 17
      Runtime/Events/OnStartEvent.cs
  13. 11
      Runtime/Events/HookBase.cs
  14. 18
      Runtime/Events/OnAwakeHook.cs
  15. 17
      Runtime/Events/OnStartHook.cs
  16. 19
      Runtime/Events/OnDestroyHook.cs
  17. 0
      /Runtime/Events.meta
  18. 0
      /Runtime/Events
  19. 0
      /Runtime/Events/EventBase.cs.meta
  20. 0
      /Runtime/Events/OnAwakeEvent.cs.meta
  21. 0
      /Runtime/Events/OnButtonDownEvent.cs.meta
  22. 0
      /Runtime/Events/OnDestroyEvent.cs.meta
  23. 0
      /Runtime/Events/OnEnableDisableEvent.cs.meta
  24. 0
      /Runtime/Events/OnKeyDownEvent.cs.meta
  25. 0
      /Runtime/Events/OnMessageEvent.cs.meta
  26. 0
      /Runtime/Events/OnPickupEvent.cs.meta
  27. 0
      /Runtime/Events/OnStartEvent.cs.meta
  28. 0
      /Runtime/Events/OnTriggerEvent.cs.meta
  29. 0
      /Runtime/Events/OnButtonDownEvent.cs
  30. 0
      /Runtime/Events/OnEnableDisableEvent.cs
  31. 0
      /Runtime/Events/OnKeyDownEvent.cs
  32. 0
      /Runtime/Events/OnMessageEvent.cs
  33. 0
      /Runtime/Events/OnPickupEvent.cs
  34. 0
      /Runtime/Events/OnTriggerEvent.cs

30
Editor/HiearchyItems.cs


{
#region TRIGGERS
[MenuItem("GameObject/GameplayIngredients/Hooks/Trigger (Box)", false, 10)]
[MenuItem("GameObject/GameplayIngredients/Events/Trigger (Box)", false, 10)]
var hook = go.AddComponent<Hooks.OnTriggerHook>();
var evt = go.AddComponent<Events.OnTriggerEvent>();
go.name = "Box Trigger";
if (Selection.activeGameObject != null)

[MenuItem("GameObject/GameplayIngredients/Hooks/Trigger (Sphere)", false, 10)]
[MenuItem("GameObject/GameplayIngredients/Events/Trigger (Sphere)", false, 10)]
var hook = go.AddComponent<Hooks.OnTriggerHook>();
var evt = go.AddComponent<Events.OnTriggerEvent>();
go.name = "Sphere Trigger";
if (Selection.activeGameObject != null)

[MenuItem("GameObject/GameplayIngredients/Hooks/Trigger (Capsule)", false, 10)]
[MenuItem("GameObject/GameplayIngredients/Events/Trigger (Capsule)", false, 10)]
var hook = go.AddComponent<Hooks.OnTriggerHook>();
var evt = go.AddComponent<Events.OnTriggerEvent>();
go.name = "Capsule Trigger";
if (Selection.activeGameObject != null)

[MenuItem("GameObject/GameplayIngredients/Hooks/On Awake", false, 10)]
[MenuItem("GameObject/GameplayIngredients/Events/On Awake", false, 10)]
var hook = go.AddComponent<Hooks.OnAwakeHook>();
go.name = "OnAwake Hook";
var evt = go.AddComponent<Events.OnAwakeEvent>();
go.name = "On Awake";
if (Selection.activeGameObject != null)
go.transform.parent = Selection.activeGameObject.transform;
}
[MenuItem("GameObject/GameplayIngredients/Events/On Enable/Disable", false, 10)]
static void CreateOnEnableDisable()
{
var go = new GameObject();
var evt = go.AddComponent<Events.OnEnableDisableEvent>();
go.name = "On Enable/Disable";
#endregion
}

4
Editor/SceneLogicEditor/SceneLogicEditor.cs


using UnityEditor;
using GraphProcessor;
using System.Reflection;
using GameplayIngredients.Hooks;
using GameplayIngredients.Events;
using GameplayIngredients.Logic;
using GameplayIngredients.Actions;

var result = new List<Type>();
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
var hookBase = typeof(HookBase);
var hookBase = typeof(EventBase);
var logicBase = typeof(LogicBase);
var actionBase = typeof(ActionBase);

4
Runtime/Events/OnButtonDownEvent.cs


using NaughtyAttributes;
using UnityEngine;
namespace GameplayIngredients.Hooks
namespace GameplayIngredients.Events
public class OnButtonDownHook : HookBase
public class OnButtonDownEvent : EventBase
{
public string Button = "Fire1";

4
Runtime/Events/OnEnableDisableEvent.cs


using NaughtyAttributes;
using UnityEngine.Events;
namespace GameplayIngredients.Hooks
namespace GameplayIngredients.Events
public class OnEnableDisableHook : HookBase
public class OnEnableDisableEvent : EventBase
{
[ReorderableList]
public Callable[] OnEnableEvent;

4
Runtime/Events/OnKeyDownEvent.cs


using NaughtyAttributes;
using UnityEngine;
namespace GameplayIngredients.Hooks
namespace GameplayIngredients.Events
public class OnKeyDownHook : HookBase
public class OnKeyDownEvent : EventBase
{
public KeyCode Key = KeyCode.F5;

4
Runtime/Events/OnMessageEvent.cs


using NaughtyAttributes;
namespace GameplayIngredients.Hooks
namespace GameplayIngredients.Events
public class OnMessageHook : HookBase
public class OnMessageEvent : EventBase
{
public string MessageName = "Message";

4
Runtime/Events/OnPickupEvent.cs


using System.Collections;
using System.Collections;
public class OnPickupHook : MonoBehaviour
public class OnPickupEvent : MonoBehaviour
{
// Start is called before the first frame update
void Start()

4
Runtime/Events/OnTriggerEvent.cs


using UnityEngine;
namespace GameplayIngredients.Hooks
namespace GameplayIngredients.Events
public class OnTriggerHook : HookBase
public class OnTriggerEvent : EventBase
{
public int EnterMaxCount = 0;
public int ExitMaxCount = 0;

11
Runtime/Events/EventBase.cs


using UnityEngine;
namespace GameplayIngredients.Events
{
public abstract class EventBase : MonoBehaviour
{
}
}

18
Runtime/Events/OnAwakeEvent.cs


using NaughtyAttributes;
using UnityEngine;
namespace GameplayIngredients.Events
{
public class OnAwakeEvent : MonoBehaviour
{
[ReorderableList]
public Callable[] onAwake;
private void Awake()
{
Callable.Call(onAwake, gameObject);
}
}
}

19
Runtime/Events/OnDestroyEvent.cs


using NaughtyAttributes;
using UnityEngine;
namespace GameplayIngredients.Events
{
public class OnDestroyEvent : MonoBehaviour
{
[ReorderableList]
public Callable[] onDestroy;
private void OnDestroy()
{
Callable.Call(onDestroy, gameObject);
}
}
}

17
Runtime/Events/OnStartEvent.cs


using NaughtyAttributes;
namespace GameplayIngredients.Events
{
public class OnStartEvent : EventBase
{
[ReorderableList]
public Callable[] OnStart;
private void Start()
{
Callable.Call(OnStart, gameObject);
}
}
}

11
Runtime/Events/HookBase.cs


using UnityEngine;
namespace GameplayIngredients.Hooks
{
public abstract class HookBase : MonoBehaviour
{
}
}

18
Runtime/Events/OnAwakeHook.cs


using NaughtyAttributes;
using UnityEngine;
namespace GameplayIngredients.Hooks
{
public class OnAwakeHook : MonoBehaviour
{
[ReorderableList]
public Callable[] onAwake;
private void Awake()
{
Callable.Call(onAwake, gameObject);
}
}
}

17
Runtime/Events/OnStartHook.cs


using NaughtyAttributes;
namespace GameplayIngredients.Hooks
{
public class OnStartHook : HookBase
{
[ReorderableList]
public Callable[] OnStart;
private void Start()
{
Callable.Call(OnStart, gameObject);
}
}
}

19
Runtime/Events/OnDestroyHook.cs


using NaughtyAttributes;
using UnityEngine;
namespace GameplayIngredients.Hooks
{
public class OnDestroyHook : MonoBehaviour
{
[ReorderableList]
public Callable[] onDestroy;
private void OnDestroy()
{
Callable.Call(onDestroy, gameObject);
}
}
}

/Runtime/Hooks.meta → /Runtime/Events.meta

/Runtime/Hooks → /Runtime/Events

/Runtime/Events/HookBase.cs.meta → /Runtime/Events/EventBase.cs.meta

/Runtime/Events/OnAwakeHook.cs.meta → /Runtime/Events/OnAwakeEvent.cs.meta

/Runtime/Events/OnButtonDownHook.cs.meta → /Runtime/Events/OnButtonDownEvent.cs.meta

/Runtime/Events/OnDestroyHook.cs.meta → /Runtime/Events/OnDestroyEvent.cs.meta

/Runtime/Events/OnEnableDisableHook.cs.meta → /Runtime/Events/OnEnableDisableEvent.cs.meta

/Runtime/Events/OnKeyDownHook.cs.meta → /Runtime/Events/OnKeyDownEvent.cs.meta

/Runtime/Events/OnMessageHook.cs.meta → /Runtime/Events/OnMessageEvent.cs.meta

/Runtime/Events/OnPickupHook.cs.meta → /Runtime/Events/OnPickupEvent.cs.meta

/Runtime/Events/OnStartHook.cs.meta → /Runtime/Events/OnStartEvent.cs.meta

/Runtime/Events/OnTriggerHook.cs.meta → /Runtime/Events/OnTriggerEvent.cs.meta

/Runtime/Events/OnButtonDownHook.cs → /Runtime/Events/OnButtonDownEvent.cs

/Runtime/Events/OnEnableDisableHook.cs → /Runtime/Events/OnEnableDisableEvent.cs

/Runtime/Events/OnKeyDownHook.cs → /Runtime/Events/OnKeyDownEvent.cs

/Runtime/Events/OnMessageHook.cs → /Runtime/Events/OnMessageEvent.cs

/Runtime/Events/OnPickupHook.cs → /Runtime/Events/OnPickupEvent.cs

/Runtime/Events/OnTriggerHook.cs → /Runtime/Events/OnTriggerEvent.cs

正在加载...
取消
保存