Skip to content

Commit

Permalink
- Else trigger on conditions and input will no longer throw an except…
Browse files Browse the repository at this point in the history
…ion when an action is null[
  • Loading branch information
DiogoDeAndrade committed May 31, 2024
1 parent b3c10c0 commit c1e6f44
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 18 deletions.
17 changes: 10 additions & 7 deletions Assets/OkapiKit/Scripts/Triggers/TriggerOnCondition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,18 @@ public virtual void ExecuteElseTrigger()

foreach (var action in elseActions)
{
if (action.action.isActionEnabled)
if (action.action != null)
{
if (action.delay > 0)
if (action.action.isActionEnabled)
{
StartCoroutine(ExecuteTriggerCR(action));
}
else
{
action.action.Execute();
if (action.delay > 0)
{
StartCoroutine(ExecuteTriggerCR(action));
}
else
{
action.action.Execute();
}
}
}
}
Expand Down
17 changes: 10 additions & 7 deletions Assets/OkapiKit/Scripts/Triggers/TriggerOnInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,18 @@ public virtual void ExecuteElseTrigger()

foreach (var action in elseActions)
{
if (action.action.isActionEnabled)
if (action.action != null)
{
if (action.delay > 0)
if (action.action.isActionEnabled)
{
StartCoroutine(ExecuteTriggerCR(action));
}
else
{
action.action.Execute();
if (action.delay > 0)
{
StartCoroutine(ExecuteTriggerCR(action));
}
else
{
action.action.Execute();
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/OkapiKit/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.videojogoslusofona.okapikit",
"displayName": "OkapiKit",
"version": "1.15.1",
"version": "1.15.2",
"unity": "2022.3",
"description": "OkapiKit is a toolkit for creation of simple games without code.",
"keywords": [ "kit" ],
Expand Down
4 changes: 2 additions & 2 deletions Assets/OkapiKitSamples/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "com.videojogoslusofona.okapikit.samples",
"displayName": "OkapiKit Samples",
"version": "1.15.1",
"version": "1.15.2",
"unity": "2022.3",
"description": "OkapiKit is a toolkit for creation of simple games without code. This package is just the samples for OkapiKit, they are not required to use Okapi Kit, and requires the Okapi Kit package.",
"keywords": [ "okapi", "samples" ],
"category": "samples",
"dependencies": {},
"relatedPackages": {
"com.videojogoslusofona.okapikit": "1.15.1"
"com.videojogoslusofona.okapikit": "1.15.2"
},
"author": {
"name": "Videojogos ULHT",
Expand Down
6 changes: 5 additions & 1 deletion ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Release Notes

## V1.15.2

- "Else" trigger on conditions and input will no longer throw an exception when an action is null

## V1.15.1

- Trigger will no longer throw an exception when an action is null
- Removed some GC from condition evaluation
- Renamed "Box" mode on camera follow to "Camera Trap"
- Renamed 'Box' mode on camera follow to 'Camera Trap'
- Added Exponential Decay camera mode, which is like Feedback Loop, but frame independent
- Added function to convert a path to world/local space, plus the ability to do that in multiple objects at the same time

Expand Down

0 comments on commit c1e6f44

Please sign in to comment.