diff options
author | chai <chaifix@163.com> | 2020-11-02 09:00:15 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-11-02 09:00:15 +0800 |
commit | 64061aee5d7849f348f07b78fc3f96ad7555c147 (patch) | |
tree | 77ea9e4dc7a34e7d324c7cc9f2f8d6e978605d8f /Assets/Scripts/Avatar/Actions/ActionSetVelocityX.cs | |
parent | e6fc3425078c4997bc035ce3636e9a756e697c4b (diff) |
*jump
Diffstat (limited to 'Assets/Scripts/Avatar/Actions/ActionSetVelocityX.cs')
-rw-r--r-- | Assets/Scripts/Avatar/Actions/ActionSetVelocityX.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Assets/Scripts/Avatar/Actions/ActionSetVelocityX.cs b/Assets/Scripts/Avatar/Actions/ActionSetVelocityX.cs new file mode 100644 index 00000000..effc3ca7 --- /dev/null +++ b/Assets/Scripts/Avatar/Actions/ActionSetVelocityX.cs @@ -0,0 +1,23 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class ActionSetVelocityX : ActionBase +{ + PhysicsBody m_Body; + + float m_VelX; + + public ActionSetVelocityX(PhysicsBody body, float x) + { + m_Body = body; + m_VelX = x; + } + + public override void Execute() + { + Vector3 v = m_Body.Velocity; + v.x = m_VelX; + m_Body.Velocity = v; + } +} |