This commit is contained in:
CortexCore
2023-11-02 20:58:55 +08:00
parent f0f348c246
commit ee3ecec6cb
168 changed files with 58830 additions and 379 deletions

View File

@@ -0,0 +1,33 @@
using UnityEngine;
namespace TrailsFX.Demos {
public class MoveObject : MonoBehaviour
{
void Update ()
{
Rigidbody rb = GetComponent<Rigidbody> ();
if (rb == null)
return;
Vector3 direction = Vector3.zero;
if (Input.GetKey (KeyCode.A)) {
direction = Vector3.right;
}
if (Input.GetKey (KeyCode.D)) {
direction = Vector3.left;
}
if (Input.GetKey (KeyCode.W)) {
direction = Vector3.back;
}
if (Input.GetKey (KeyCode.S)) {
direction = Vector3.forward;
}
rb.AddForce (direction * 10);
}
}
}