From 64061aee5d7849f348f07b78fc3f96ad7555c147 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 2 Nov 2020 09:00:15 +0800 Subject: *jump --- .../Scripts/Avatar/Actions/ActionSetVelocityX.cs | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Assets/Scripts/Avatar/Actions/ActionSetVelocityX.cs (limited to 'Assets/Scripts/Avatar/Actions/ActionSetVelocityX.cs') 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; + } +} -- cgit v1.1-26-g67d0