init: init commit

This commit is contained in:
2026-07-02 23:06:14 +08:00
commit 1995835c12
39 changed files with 4894 additions and 0 deletions

52
Assets/scripts/Moving.cs Normal file
View File

@@ -0,0 +1,52 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Moving : MonoBehaviour
{
public float speed = 5f;
[SerializeField]
private Rigidbody rb;
[SerializeField]
private float jumpForce = 5f;
void Start()
{
}
// Update is called once per frame
void Update()
{
Vector3 direction = Vector3.zero;
if (Input.GetKey(KeyCode.W))
direction += Vector3.forward;
if (Input.GetKey(KeyCode.S))
direction += Vector3.back;
if (Input.GetKey(KeyCode.A))
direction += Vector3.left;
if (Input.GetKey(KeyCode.D))
direction += Vector3.right;
if (Input.GetKeyDown(KeyCode.Space))
rb.AddForce(Vector3.up * jumpForce, ForceMode.Impulse);
if (Input.GetKey(KeyCode.LeftControl))
Debug.Log("left ctrl active");
direction = direction.normalized;
transform.position += direction * (speed * Time.deltaTime);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8ca2545ae1781c747a2c7cf0c93540bc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: