-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(quest events): quest collection now has event hooks
You can subscribe to add, complete, update, and task complete events. Extremely useful for post processing tasks and quests with extra meta data
- Loading branch information
Showing
11 changed files
with
286 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
Assets/com.fluid.quest-journal/Runtime/Scripts/Utilities/Events.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
Assets/com.fluid.quest-journal/Runtime/Scripts/Utilities/Events/IUnityEventReadOnly.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using UnityEngine.Events; | ||
|
||
namespace CleverCrow.Fluid.QuestJournals.Utilities { | ||
public interface IUnityEventReadOnly { | ||
void AddListener (UnityAction call); | ||
void RemoveListener (UnityAction call); | ||
} | ||
|
||
public interface IUnityEventReadOnly<T> { | ||
void AddListener (UnityAction<T> call); | ||
void RemoveListener (UnityAction<T> call); | ||
} | ||
|
||
public interface IUnityEventReadOnly<T1, T2> { | ||
void AddListener (UnityAction<T1, T2> call); | ||
void RemoveListener (UnityAction<T1, T2> call); | ||
} | ||
|
||
public interface IUnityEventReadOnly<T1, T2, T3> { | ||
void AddListener (UnityAction<T1, T2, T3> call); | ||
void RemoveListener (UnityAction<T1, T2, T3> call); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Assets/com.fluid.quest-journal/Runtime/Scripts/Utilities/Events/IUnityEventReadOnly.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
Assets/com.fluid.quest-journal/Runtime/Scripts/Utilities/Events/IUnityEventSafe.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace CleverCrow.Fluid.QuestJournals.Utilities { | ||
public interface IUnityEventSafe : IUnityEventReadOnly { | ||
void Invoke (); | ||
} | ||
|
||
public interface IUnityEventSafe<T> : IUnityEventReadOnly<T> { | ||
void Invoke (T arg); | ||
} | ||
|
||
public interface IUnityEventSafe<T1, T2> : IUnityEventReadOnly<T1, T2> { | ||
void Invoke (T1 arg1, T2 arg2); | ||
} | ||
|
||
public interface IUnityEventSafe<T1, T2, T3> : IUnityEventReadOnly<T1, T2, T3> { | ||
void Invoke (T1 arg1, T2 arg2, T3 arg3); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Assets/com.fluid.quest-journal/Runtime/Scripts/Utilities/Events/IUnityEventSafe.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
Assets/com.fluid.quest-journal/Runtime/Scripts/Utilities/Events/UnityEventSafe.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using UnityEngine.Events; | ||
|
||
namespace CleverCrow.Fluid.QuestJournals.Utilities { | ||
/// <summary> | ||
/// Unity events designed for external public class safety. Only allows for basic subscribe and unsubscribe behaviors via IUnityEventReadOnly | ||
/// </summary> | ||
[System.Serializable] | ||
public class UnityEventSafe : UnityEvent, IUnityEventSafe { | ||
} | ||
|
||
public class UnityEventSafe<T1> : UnityEvent<T1>, IUnityEventSafe<T1> { | ||
} | ||
|
||
public class UnityEventSafe<T1, T2> : UnityEvent<T1, T2>, IUnityEventSafe<T1, T2> { | ||
} | ||
|
||
public class UnityEventSafe<T1, T2, T3> : UnityEvent<T1, T2, T3>, IUnityEventSafe<T1, T2, T3> { | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Assets/com.fluid.quest-journal/Runtime/Scripts/Utilities/Events/UnityEventSafe.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.