-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
List of hit hurtables per group can now be accessed via GetHitList.
- Loading branch information
1 parent
59676c7
commit 77d6a90
Showing
11 changed files
with
285 additions
and
18 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
Assets/CAF/Samples/TDAction/Scripts/Combat/Events/ApplyFriction.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,52 @@ | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using CAF.Combat; | ||
#if UNITY_EDITOR | ||
using UnityEditor; | ||
#endif | ||
|
||
namespace TDAction.Combat.Events | ||
{ | ||
public class ApplyFriction : AttackEvent | ||
{ | ||
public bool xFriction; | ||
public bool yFriction; | ||
|
||
public override string GetName() | ||
{ | ||
return "Friction"; | ||
} | ||
|
||
public override bool Evaluate(uint frame, uint endFrame, | ||
CAF.Entities.EntityManager controller, AttackEventVariables variables) | ||
{ | ||
if (xFriction) | ||
{ | ||
controller.PhysicsManager.ApplyMovementFriction(variables.floatVars[0]); | ||
} | ||
if (yFriction) | ||
{ | ||
controller.PhysicsManager.ApplyGravityFriction(variables.floatVars[0]); | ||
} | ||
return false; | ||
} | ||
|
||
#if UNITY_EDITOR | ||
public override void DrawEventVariables(CAF.Combat.AttackEventDefinition eventDefinition) | ||
{ | ||
if (eventDefinition.variables.floatVars == null | ||
|| eventDefinition.variables.floatVars.Count != 1) | ||
{ | ||
eventDefinition.variables.floatVars = new List<float>(1); | ||
eventDefinition.variables.floatVars.Add(0); | ||
} | ||
|
||
xFriction = EditorGUILayout.Toggle("X-Axis", xFriction); | ||
yFriction = EditorGUILayout.Toggle("Y-Axis", yFriction); | ||
|
||
eventDefinition.variables.floatVars[0] = EditorGUILayout.FloatField("Friction", | ||
eventDefinition.variables.floatVars[0]); | ||
} | ||
#endif | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/CAF/Samples/TDAction/Scripts/Combat/Events/ApplyFriction.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.